From b458583b76e84204dca17587625757247bb4053e Mon Sep 17 00:00:00 2001 From: IceberGu Date: Tue, 2 Feb 2021 15:36:49 +0800 Subject: [PATCH] runtime: fix shutdown runc v2 service Signed-off-by: IceberGu --- runtime/v2/runc/v2/service.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/v2/runc/v2/service.go b/runtime/v2/runc/v2/service.go index cf478ca5e..3dd5b7df9 100644 --- a/runtime/v2/runc/v2/service.go +++ b/runtime/v2/runc/v2/service.go @@ -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()