[#1689] getSvc: Stop node addresses iteratation on logical errors
All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m38s
Pre-commit hooks / Pre-commit (push) Successful in 2m12s
Build / Build Components (push) Successful in 2m14s
Tests and linters / Run gofumpt (push) Successful in 2m8s
Tests and linters / Staticcheck (push) Successful in 3m2s
Tests and linters / Tests (push) Successful in 3m37s
Tests and linters / Lint (push) Successful in 4m7s
OCI image / Build container images (push) Successful in 4m39s
Tests and linters / Tests with -race (push) Successful in 4m43s
Tests and linters / gopls check (push) Successful in 4m46s
All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m38s
Pre-commit hooks / Pre-commit (push) Successful in 2m12s
Build / Build Components (push) Successful in 2m14s
Tests and linters / Run gofumpt (push) Successful in 2m8s
Tests and linters / Staticcheck (push) Successful in 3m2s
Tests and linters / Tests (push) Successful in 3m37s
Tests and linters / Lint (push) Successful in 4m7s
OCI image / Build container images (push) Successful in 4m39s
Tests and linters / Tests with -race (push) Successful in 4m43s
Tests and linters / gopls check (push) Successful in 4m46s
Before this fix: If first node address returns non-logical error (context deadline exceeded, context canceled, etc), then this error will override logical error from second node address. Change-Id: Ib30d0209828fdc83b55308ca2e33a361aa4caee6 Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
e0a4835ea3
commit
6cedfbc17a
1 changed files with 13 additions and 11 deletions
|
@ -3,6 +3,7 @@ package getsvc
|
|||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
"hash"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client"
|
||||
|
@ -358,19 +359,20 @@ func groupAddressRequestForwarder(f func(context.Context, network.Address, clien
|
|||
|
||||
info.AddressGroup().IterateAddresses(func(addr network.Address) (stop bool) {
|
||||
var err error
|
||||
|
||||
defer func() {
|
||||
stop = err == nil
|
||||
|
||||
if stop || firstErr == nil {
|
||||
firstErr = err
|
||||
}
|
||||
|
||||
// would be nice to log otherwise
|
||||
}()
|
||||
|
||||
res, err = f(ctx, addr, c, key)
|
||||
|
||||
// non-status logic error that could be returned
|
||||
// from the SDK client; should not be considered
|
||||
// as a connection error
|
||||
var siErr *objectSDK.SplitInfoError
|
||||
var eiErr *objectSDK.ECInfoError
|
||||
|
||||
stop = err == nil || errors.As(err, &siErr) || errors.As(err, &eiErr)
|
||||
|
||||
if stop || firstErr == nil {
|
||||
firstErr = err
|
||||
}
|
||||
|
||||
return
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue