Skip to content

Commit 610498d

Browse files
committed
Fix for [cri] ttrpc: closed during ListPodSandboxStats
Signed-off-by: Davanum Srinivas <[email protected]>
1 parent 2bf793e commit 610498d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cri/server/sandbox_stats_list.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ package server
1818

1919
import (
2020
"context"
21+
"errors"
2122
"fmt"
2223

2324
sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
2425
"github.com/containerd/errdefs"
2526
"github.com/containerd/log"
27+
"github.com/containerd/ttrpc"
2628
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
2729

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

0 commit comments

Comments
 (0)