mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-22 19:19:09 +00:00
cli: increase NeoFS pool deadlines for upload-bin command
`defaultDialTimeout` and `defaultStreamTimeout` increased because of `code = DeadlineExceeded desc = context deadline exceeded` Close #3620 Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
8e1fdd5d70
commit
41873e35c6
1 changed files with 16 additions and 3 deletions
|
@ -42,13 +42,21 @@ const (
|
||||||
// Constants related to retry mechanism.
|
// Constants related to retry mechanism.
|
||||||
const (
|
const (
|
||||||
// Maximum number of retries.
|
// Maximum number of retries.
|
||||||
maxRetries = 3
|
maxRetries = 5
|
||||||
// Initial backoff duration.
|
// Initial backoff duration.
|
||||||
initialBackoff = 500 * time.Millisecond
|
initialBackoff = 500 * time.Millisecond
|
||||||
// Backoff multiplier.
|
// Backoff multiplier.
|
||||||
backoffFactor = 2
|
backoffFactor = 2
|
||||||
// Maximum backoff duration.
|
// Maximum backoff duration.
|
||||||
maxBackoff = 10 * time.Second
|
maxBackoff = 20 * time.Second
|
||||||
|
)
|
||||||
|
|
||||||
|
// Constants related to NeoFS pool request timeouts.
|
||||||
|
// Such big values are used to avoid NeoFS pool timeouts during block search and upload.
|
||||||
|
const (
|
||||||
|
defaultDialTimeout = 10 * time.Minute
|
||||||
|
defaultStreamTimeout = 10 * time.Minute
|
||||||
|
defaultHealthcheckTimeout = 10 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
func uploadBin(ctx *cli.Context) error {
|
func uploadBin(ctx *cli.Context) error {
|
||||||
|
@ -82,7 +90,12 @@ func uploadBin(ctx *cli.Context) error {
|
||||||
fmt.Fprintln(ctx.App.Writer, "Chain block height:", currentBlockHeight)
|
fmt.Fprintln(ctx.App.Writer, "Chain block height:", currentBlockHeight)
|
||||||
|
|
||||||
signer := user.NewAutoIDSignerRFC6979(acc.PrivateKey().PrivateKey)
|
signer := user.NewAutoIDSignerRFC6979(acc.PrivateKey().PrivateKey)
|
||||||
p, err := pool.New(pool.NewFlatNodeParams(rpcNeoFS), signer, pool.DefaultOptions())
|
|
||||||
|
params := pool.DefaultOptions()
|
||||||
|
params.SetHealthcheckTimeout(defaultHealthcheckTimeout)
|
||||||
|
params.SetNodeDialTimeout(defaultDialTimeout)
|
||||||
|
params.SetNodeStreamTimeout(defaultStreamTimeout)
|
||||||
|
p, err := pool.New(pool.NewFlatNodeParams(rpcNeoFS), signer, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cli.Exit(fmt.Sprintf("failed to create NeoFS pool: %v", err), 1)
|
return cli.Exit(fmt.Sprintf("failed to create NeoFS pool: %v", err), 1)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue