runtime: fix shutdown runc v2 service
Signed-off-by: IceberGu <wei.cai-nat@daocloud.io>
This commit is contained in:
parent
a39478ab9a
commit
b458583b76
@ -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) {
|
func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*ptypes.Empty, error) {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
|
defer s.mu.Unlock()
|
||||||
|
|
||||||
// return out if the shim is still servicing containers
|
// return out if the shim is still servicing containers
|
||||||
if len(s.containers) > 0 {
|
if len(s.containers) > 0 {
|
||||||
s.mu.Unlock()
|
|
||||||
return empty, nil
|
return empty, nil
|
||||||
}
|
}
|
||||||
s.cancel()
|
s.cancel()
|
||||||
|
Loading…
Reference in New Issue
Block a user