Close epoller on task stop
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
781ce658c8
commit
7030a4add0
@ -62,6 +62,7 @@ func NewService(config Config, publisher events.Publisher) (*Service, error) {
|
||||
type platform interface {
|
||||
copyConsole(ctx context.Context, console console.Console, stdin, stdout, stderr string, wg, cwg *sync.WaitGroup) (console.Console, error)
|
||||
shutdownConsole(ctx context.Context, console console.Console) error
|
||||
close() error
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
@ -146,6 +147,7 @@ func (s *Service) Delete(ctx context.Context, r *google_protobuf.Empty) (*shimap
|
||||
return nil, err
|
||||
}
|
||||
s.deleteProcess(p.ID())
|
||||
s.platform.close()
|
||||
s.events <- &eventsapi.TaskDelete{
|
||||
ContainerID: s.id,
|
||||
ExitStatus: uint32(p.ExitStatus()),
|
||||
|
@ -69,6 +69,10 @@ func (p *linuxPlatform) shutdownConsole(ctx context.Context, cons console.Consol
|
||||
return epollConsole.Shutdown(p.epoller.CloseConsole)
|
||||
}
|
||||
|
||||
func (p *linuxPlatform) close() error {
|
||||
return p.epoller.Close()
|
||||
}
|
||||
|
||||
// initialize a single epoll fd to manage our consoles. `initPlatform` should
|
||||
// only be called once.
|
||||
func (s *Service) initPlatform() error {
|
||||
|
@ -52,6 +52,10 @@ func (p *unixPlatform) shutdownConsole(ctx context.Context, cons console.Console
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *unixPlatform) close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Service) initPlatform() error {
|
||||
s.platform = &unixPlatform{}
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user