runtime: ignore ttrpc.ErrClosed when delete task
For some reason, shimv2 process doesn't exist. The ttrpc doesn't detect the connection closed by server until delete task. For this case, we should ignore the ttrpc.ErrClosed and let task manager handle the cleanup. Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
parent
5bfab78acd
commit
0116352e1b
@ -226,9 +226,12 @@ func (s *shim) Delete(ctx context.Context) (*runtime.Exit, error) {
|
||||
ID: s.ID(),
|
||||
})
|
||||
if shimErr != nil {
|
||||
shimErr = errdefs.FromGRPC(shimErr)
|
||||
if !errdefs.IsNotFound(shimErr) {
|
||||
return nil, shimErr
|
||||
log.G(ctx).WithField("id", s.ID()).WithError(shimErr).Debug("failed to delete task")
|
||||
if errors.Cause(shimErr) != ttrpc.ErrClosed {
|
||||
shimErr = errdefs.FromGRPC(shimErr)
|
||||
if !errdefs.IsNotFound(shimErr) {
|
||||
return nil, shimErr
|
||||
}
|
||||
}
|
||||
}
|
||||
// remove self from the runtime task list
|
||||
|
Loading…
Reference in New Issue
Block a user