diff --git a/core/runtime/v2/shim.go b/core/runtime/v2/shim.go index f7855c2a14e99..1358462ec8cc7 100644 --- a/core/runtime/v2/shim.go +++ b/core/runtime/v2/shim.go @@ -835,6 +835,9 @@ func (s *shimTask) State(ctx context.Context) (runtime.State, error) { ID: s.ID(), }) if err != nil { + if errdefs.IsDeadlineExceeded(err) { + return runtime.State{}, err + } if !errors.Is(err, ttrpc.ErrClosed) { return runtime.State{}, errgrpc.ToNative(err) } diff --git a/plugins/services/tasks/local.go b/plugins/services/tasks/local.go index 30385e0bb481b..8d2fa42fcdc96 100644 --- a/plugins/services/tasks/local.go +++ b/plugins/services/tasks/local.go @@ -349,7 +349,7 @@ func getProcessState(ctx context.Context, p runtime.Process) (*task.Process, err state, err := p.State(ctx) if err != nil { - if errdefs.IsNotFound(err) || errdefs.IsUnavailable(err) { + if errdefs.IsNotFound(err) || errdefs.IsUnavailable(err) || errdefs.IsDeadlineExceeded(err) { return nil, err } log.G(ctx).WithError(err).Errorf("get state for %s", p.ID())