diff --git a/cmd/s3-gw/app.go b/cmd/s3-gw/app.go index 14f9b17e..72b49baf 100644 --- a/cmd/s3-gw/app.go +++ b/cmd/s3-gw/app.go @@ -783,9 +783,8 @@ func (a *App) initPools(ctx context.Context) { prm.SetNodeDialTimeout(connTimeout) prmTree.SetNodeDialTimeout(connTimeout) - streamTimeout := fetchStreamTimeout(a.config()) - prm.SetNodeStreamTimeout(streamTimeout) - prmTree.SetNodeStreamTimeout(streamTimeout) + prm.SetNodeStreamTimeout(fetchStreamTimeout(a.config(), cfgStreamTimeout)) + prmTree.SetNodeStreamTimeout(fetchStreamTimeout(a.config(), cfgTreeStreamTimeout)) healthCheckTimeout := fetchHealthCheckTimeout(a.config()) prm.SetHealthcheckTimeout(healthCheckTimeout) diff --git a/cmd/s3-gw/app_settings.go b/cmd/s3-gw/app_settings.go index a3c225e9..ff888567 100644 --- a/cmd/s3-gw/app_settings.go +++ b/cmd/s3-gw/app_settings.go @@ -123,6 +123,7 @@ const ( // Settings. // Pool config. cfgConnectTimeout = "connect_timeout" cfgStreamTimeout = "stream_timeout" + cfgTreeStreamTimeout = "tree_stream_timeout" cfgHealthcheckTimeout = "healthcheck_timeout" cfgRebalanceInterval = "rebalance_interval" cfgPoolErrorThreshold = "pool_error_threshold" @@ -363,8 +364,8 @@ func fetchReconnectInterval(cfg *viper.Viper) time.Duration { return reconnect } -func fetchStreamTimeout(cfg *viper.Viper) time.Duration { - streamTimeout := cfg.GetDuration(cfgStreamTimeout) +func fetchStreamTimeout(cfg *viper.Viper, cfgEntry string) time.Duration { + streamTimeout := cfg.GetDuration(cfgEntry) if streamTimeout <= 0 { streamTimeout = defaultStreamTimeout } diff --git a/config/config.env b/config/config.env index 1e3268ed..0c314912 100644 --- a/config/config.env +++ b/config/config.env @@ -80,8 +80,10 @@ S3_GW_PROMETHEUS_ADDRESS=localhost:8086 # Timeout to connect to a node S3_GW_CONNECT_TIMEOUT=10s -# Timeout for individual operations in streaming RPC. +# Timeout for individual operations in object pool streaming RPC. S3_GW_STREAM_TIMEOUT=10s +# Timeout for individual operations in tree pool streaming RPC. +S3_GW_TREE_STREAM_TIMEOUT=10s # Timeout to check node health during rebalance. S3_GW_HEALTHCHECK_TIMEOUT=15s # Interval to check node health diff --git a/config/config.yaml b/config/config.yaml index b3f86f8b..9b82b4e1 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -100,8 +100,10 @@ tracing: # Timeout to connect to a node connect_timeout: 10s -# Timeout for individual operations in streaming RPC. +# Timeout for individual operations in object pool streaming RPC. stream_timeout: 10s +# Timeout for individual operations in tree pool streaming RPC. +tree_stream_timeout: 10s # Timeout to check node health during rebalance healthcheck_timeout: 15s # Interval to check node health diff --git a/docs/configuration.md b/docs/configuration.md index aa0db197..665b49b9 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -215,6 +215,7 @@ resolve_order: connect_timeout: 10s stream_timeout: 10s +tree_stream_timeout: 10s healthcheck_timeout: 15s rebalance_interval: 60s pool_error_threshold: 100 @@ -237,7 +238,8 @@ source_ip_header: "Source-Ip" | `rpc_endpoint` | `string` | no | | The address of the RPC host to which the gateway connects to resolve bucket names and interact with frostfs contracts (required to use the `nns` resolver and `frostfsid` contract). | | `resolve_order` | `[]string` | yes | `[dns]` | Order of bucket name resolvers to use. Available resolvers: `dns`, `nns`. | | `connect_timeout` | `duration` | no | `10s` | Timeout to connect to a node. | -| `stream_timeout` | `duration` | no | `10s` | Timeout for individual operations in streaming RPC. | +| `stream_timeout` | `duration` | no | `10s` | Timeout for individual operations in object pool streaming RPC. | +| `tree_stream_timeout` | `duration` | no | `10s` | Timeout for individual operations in tree pool streaming RPC. | | `healthcheck_timeout` | `duration` | no | `15s` | Timeout to check node health during rebalance. | | `rebalance_interval` | `duration` | no | `60s` | Interval to check node health. | | `pool_error_threshold` | `uint32` | no | `100` | The number of errors on connection after which node is considered as unhealthy. |