Skip to content

Commit

Permalink
Merge pull request containerd#10423 from dims/cri-ttrpc-closed-during…
Browse files Browse the repository at this point in the history
…-ListPodSandboxStats

Fix for `[cri] ttrpc: closed` during ListPodSandboxStats
  • Loading branch information
dmcgowan authored Jul 9, 2024
2 parents 6e67345 + 610498d commit 923bb1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cri/server/sandbox_stats_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ package server

import (
"context"
"errors"
"fmt"

sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/ttrpc"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/hashicorp/go-multierror"
Expand All @@ -42,6 +44,8 @@ func (c *criService) ListPodSandboxStats(
switch {
case errdefs.IsUnavailable(err), errdefs.IsNotFound(err):
log.G(ctx).WithField("podsandboxid", sandbox.ID).Debugf("failed to get pod sandbox stats, this is likely a transient error: %v", err)
case errors.Is(err, ttrpc.ErrClosed):
log.G(ctx).WithField("podsandboxid", sandbox.ID).Debugf("failed to get pod sandbox stats, connection closed: %v", err)
case err != nil:
errs = multierror.Append(errs, fmt.Errorf("failed to decode sandbox container metrics for sandbox %q: %w", sandbox.ID, err))
default:
Expand Down

0 comments on commit 923bb1f

Please sign in to comment.