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.

Fixes #2767.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
  • Loading branch information
cthulhu-rider committed Mar 19, 2024
1 parent 06994b9 commit 01efda8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Changelog for NeoFS Node
- Storage nodes no longer reject GET w/ TTL=1 requests to read complex objects (#2447)
- Response exceeding the deadline for TLS errors (#2561)
- `neofs-adm morph generate-storage-wallet` was not able to read `--initial-gas` flag (#2766)
- Inter-node connections closed on any status response (#2767)

### Changed
- IR now checks format of NULL and numeric eACL filters specified in the protocol (#2742)
Expand Down
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 01efda8

Please sign in to comment.