Skip to content

Commit 263adda

Browse files
authored
Fix false-negative GET/HEAD/RANGE (#3840)
2 parents 5ab98cc + 6fae0b6 commit 263adda

3 files changed

Lines changed: 7 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Changelog for NeoFS Node
1010
- GC deadlock on local object storage shutdown (#3837)
1111
- `owner mismatches signature` for stored objects (#3836)
1212
- SN does not retry resending failed transaction because of insufficient GAS in some cases (#3839)
13+
- Too early GET/HEAD/RANGE request failure on single SN dial failure (#3840)
1314

1415
### Changed
1516
- SN returns unsigned responses to requests with API >= `v2.22` (#3785)

pkg/services/object/get/exec.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"io"
99

10-
clientcore "github.com/nspcc-dev/neofs-node/pkg/core/client"
1110
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
1211
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
1312
"github.com/nspcc-dev/neofs-sdk-go/netmap"
@@ -296,18 +295,6 @@ func (exec *execCtx) headChild(id oid.ID) (*object.Object, bool) {
296295
return nil, false
297296
}
298297

299-
func (exec *execCtx) remoteClient(info clientcore.NodeInfo) (getClient, bool) {
300-
c, err := exec.svc.clientCache.get(exec.context(), info)
301-
302-
if err == nil {
303-
return c, true
304-
}
305-
exec.status = statusUndefined
306-
exec.err = err
307-
exec.log.Debug("could not construct remote node client")
308-
return nil, false
309-
}
310-
311298
func mergeSplitInfo(dst, src *object.SplitInfo) {
312299
if last := src.GetLastPart(); !last.IsZero() {
313300
dst.SetLastPart(last)

pkg/services/object/get/remote.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ import (
1212
func (exec *execCtx) processNode(info client.NodeInfo) bool {
1313
exec.log.Debug("processing node...", zap.Stringers("address group", info.AddressGroup()))
1414

15-
remoteClient, ok := exec.remoteClient(info)
16-
if !ok {
17-
return true
15+
remoteClient, err := exec.svc.clientCache.get(exec.context(), info)
16+
if err != nil {
17+
exec.status = statusUndefined
18+
exec.err = err
19+
exec.log.Debug("could not construct remote node client", zap.Error(err))
20+
return false
1821
}
1922

2023
obj, reader, err := remoteClient.getObject(exec)

0 commit comments

Comments
 (0)