forked from TrueCloudLab/frostfs-s3-gw
[#628] Add tree_stream_timeout config parameter
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
da9703ab63
commit
5538dce772
5 changed files with 14 additions and 8 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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. |
|
||||
|
|
Loading…
Add table
Reference in a new issue