Merge pull request #4988 from Iceber/fix-runc-v2-service

runtime: fix shutdown runc v2 service
This commit is contained in:
Phil Estes 2021-02-02 09:05:26 -05:00 committed by GitHub
commit f07e1811ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -662,9 +662,10 @@ func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (*task
func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*ptypes.Empty, error) {
s.mu.Lock()
defer s.mu.Unlock()
// return out if the shim is still servicing containers
if len(s.containers) > 0 {
s.mu.Unlock()
return empty, nil
}
s.cancel()