Skip to content

Commit

Permalink
node: Do not close connection with node on NeoFS status responses
Browse files Browse the repository at this point in the history
Previously, storage node closed connection with the remote node on any
status response from it for configured period of time (e.g. 30s). This
was fundamentally incorrect since status responses can only come from
"healthy" nodes.

From now status responses don't affect inter-node connections.

Closes #2767.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
  • Loading branch information
cthulhu-rider committed Mar 19, 2024
1 parent 06994b9 commit f8a531e
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 @@ -11,6 +11,7 @@ import (
clientcore "github.com/nspcc-dev/neofs-node/pkg/core/client"
"github.com/nspcc-dev/neofs-node/pkg/network"
"github.com/nspcc-dev/neofs-sdk-go/client"
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
"github.com/nspcc-dev/neofs-sdk-go/container"
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
Expand Down Expand Up @@ -186,6 +187,11 @@ func (x *multiClient) ReportError(err error) {
return
}

// NeoFS status responses mean connection is OK
if errors.Is(err, apistatus.Error) {
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 f8a531e

Please sign in to comment.