From 2095093fd2d41faff65cd3a9cff7af9e9b9c9f7b Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Fri, 9 Jun 2023 17:17:30 -0700 Subject: [PATCH] When fetch pid counts the contianer can be in an invalid state sometimes Signed-off-by: James Sturtevant --- cmd/containerd-shim-runhcs-v1/task_hcs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/containerd-shim-runhcs-v1/task_hcs.go b/cmd/containerd-shim-runhcs-v1/task_hcs.go index 224735a242..f355955105 100644 --- a/cmd/containerd-shim-runhcs-v1/task_hcs.go +++ b/cmd/containerd-shim-runhcs-v1/task_hcs.go @@ -566,6 +566,9 @@ func (ht *hcsTask) Pids(ctx context.Context) ([]runhcsopts.ProcessDetails, error // Get the guest pids props, err := ht.c.Properties(ctx, schema1.PropertyTypeProcessList) if err != nil { + if isStatsNotFound(err) { + return nil, errors.Wrapf(errdefs.ErrNotFound, "failed to fetch pids: %s", err) + } return nil, err }