Skip to content

Commit 90c309f

Browse files
committed
Add IsNotFound case to ListPodSandboxStats
Fixes #10013. It seems we can end up in a spot where the sandbox store still has a listing for a pod, whereas containerds underlying store has removed it. It might be better to shield the caller (k8s) from these transient errors. Signed-off-by: Danny Canter <[email protected]> (cherry picked from commit 2474a99) Signed-off-by: Danny Canter <[email protected]>
1 parent 926c958 commit 90c309f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/cri/server/sandbox_stats_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (c *criService) ListPodSandboxStats(
4040
for _, sandbox := range sandboxes {
4141
sandboxStats, err := c.podSandboxStats(ctx, sandbox)
4242
switch {
43-
case errdefs.IsUnavailable(err):
43+
case errdefs.IsUnavailable(err), errdefs.IsNotFound(err):
4444
log.G(ctx).WithField("podsandboxid", sandbox.ID).Debugf("failed to get pod sandbox stats, this is likely a transient error: %v", err)
4545
case err != nil:
4646
errs = multierror.Append(errs, fmt.Errorf("failed to decode sandbox container metrics for sandbox %q: %w", sandbox.ID, err))

0 commit comments

Comments
 (0)