Skip to content

Commit

Permalink
cli: increase NeoFS pool deadlines for upload-bin command
Browse files Browse the repository at this point in the history
`defaultDialTimeout` and `defaultStreamTimeout` increased because of
`code = DeadlineExceeded desc = context deadline exceeded`

Close #3620

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Oct 18, 2024
1 parent 14ea5a8 commit 1d2166b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions cli/util/uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ const (
// Constants related to retry mechanism.
const (
// Maximum number of retries.
maxRetries = 3
maxRetries = 10
// Initial backoff duration.
initialBackoff = 500 * time.Millisecond
// Backoff multiplier.
backoffFactor = 2
// Maximum backoff duration.
maxBackoff = 10 * time.Second
maxBackoff = 20 * time.Second
)

// Constants related to NeoFS pool request timeouts.
const (
defaultDialTimeout = 10 * time.Minute
defaultStreamTimeout = 10 * time.Minute
)

func uploadBin(ctx *cli.Context) error {
Expand Down Expand Up @@ -82,7 +88,11 @@ func uploadBin(ctx *cli.Context) error {
fmt.Fprintln(ctx.App.Writer, "Chain block height:", currentBlockHeight)

signer := user.NewAutoIDSignerRFC6979(acc.PrivateKey().PrivateKey)
p, err := pool.New(pool.NewFlatNodeParams(rpcNeoFS), signer, pool.DefaultOptions())

params := pool.DefaultOptions()
params.SetNodeDialTimeout(defaultDialTimeout)
params.SetNodeStreamTimeout(defaultStreamTimeout)
p, err := pool.New(pool.NewFlatNodeParams(rpcNeoFS), signer, params)
if err != nil {
return cli.Exit(fmt.Sprintf("failed to create NeoFS pool: %v", err), 1)
}
Expand Down

0 comments on commit 1d2166b

Please sign in to comment.