Skip to content

Commit

Permalink
[#2260] network/cache: Ignore context cancelled errors
Browse files Browse the repository at this point in the history
Timeouts on client side should node affect inter-node communication.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
  • Loading branch information
fyrchik committed Feb 17, 2023
1 parent d524425 commit 3c6fcf5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/network/cache/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/network"
"github.com/nspcc-dev/neofs-sdk-go/client"
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

type singleClient struct {
Expand Down Expand Up @@ -172,6 +174,10 @@ func (x *multiClient) ReportError(err error) {
return
}

if status.Code(err) == codes.Canceled || errors.Is(err, context.Canceled) {
return
}

// non-status logic error that could be returned
// from the SDK client; should not be considered
// as a connection error
Expand Down

0 comments on commit 3c6fcf5

Please sign in to comment.