Skip to content

Commit b458583

Browse files
committed
runtime: fix shutdown runc v2 service
Signed-off-by: IceberGu <wei.cai-nat@daocloud.io>
1 parent a39478a commit b458583

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runtime/v2/runc/v2/service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,10 @@ func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (*task
662662

663663
func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*ptypes.Empty, error) {
664664
s.mu.Lock()
665+
defer s.mu.Unlock()
666+
665667
// return out if the shim is still servicing containers
666668
if len(s.containers) > 0 {
667-
s.mu.Unlock()
668669
return empty, nil
669670
}
670671
s.cancel()

0 commit comments

Comments
 (0)