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)
|
prm.SetNodeDialTimeout(connTimeout)
|
||||||
prmTree.SetNodeDialTimeout(connTimeout)
|
prmTree.SetNodeDialTimeout(connTimeout)
|
||||||
|
|
||||||
streamTimeout := fetchStreamTimeout(a.config())
|
prm.SetNodeStreamTimeout(fetchStreamTimeout(a.config(), cfgStreamTimeout))
|
||||||
prm.SetNodeStreamTimeout(streamTimeout)
|
prmTree.SetNodeStreamTimeout(fetchStreamTimeout(a.config(), cfgTreeStreamTimeout))
|
||||||
prmTree.SetNodeStreamTimeout(streamTimeout)
|
|
||||||
|
|
||||||
healthCheckTimeout := fetchHealthCheckTimeout(a.config())
|
healthCheckTimeout := fetchHealthCheckTimeout(a.config())
|
||||||
prm.SetHealthcheckTimeout(healthCheckTimeout)
|
prm.SetHealthcheckTimeout(healthCheckTimeout)
|
||||||
|
|
|
@ -123,6 +123,7 @@ const ( // Settings.
|
||||||
// Pool config.
|
// Pool config.
|
||||||
cfgConnectTimeout = "connect_timeout"
|
cfgConnectTimeout = "connect_timeout"
|
||||||
cfgStreamTimeout = "stream_timeout"
|
cfgStreamTimeout = "stream_timeout"
|
||||||
|
cfgTreeStreamTimeout = "tree_stream_timeout"
|
||||||
cfgHealthcheckTimeout = "healthcheck_timeout"
|
cfgHealthcheckTimeout = "healthcheck_timeout"
|
||||||
cfgRebalanceInterval = "rebalance_interval"
|
cfgRebalanceInterval = "rebalance_interval"
|
||||||
cfgPoolErrorThreshold = "pool_error_threshold"
|
cfgPoolErrorThreshold = "pool_error_threshold"
|
||||||
|
@ -363,8 +364,8 @@ func fetchReconnectInterval(cfg *viper.Viper) time.Duration {
|
||||||
return reconnect
|
return reconnect
|
||||||
}
|
}
|
||||||
|
|
||||||
func fetchStreamTimeout(cfg *viper.Viper) time.Duration {
|
func fetchStreamTimeout(cfg *viper.Viper, cfgEntry string) time.Duration {
|
||||||
streamTimeout := cfg.GetDuration(cfgStreamTimeout)
|
streamTimeout := cfg.GetDuration(cfgEntry)
|
||||||
if streamTimeout <= 0 {
|
if streamTimeout <= 0 {
|
||||||
streamTimeout = defaultStreamTimeout
|
streamTimeout = defaultStreamTimeout
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,8 +80,10 @@ S3_GW_PROMETHEUS_ADDRESS=localhost:8086
|
||||||
|
|
||||||
# Timeout to connect to a node
|
# Timeout to connect to a node
|
||||||
S3_GW_CONNECT_TIMEOUT=10s
|
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
|
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.
|
# Timeout to check node health during rebalance.
|
||||||
S3_GW_HEALTHCHECK_TIMEOUT=15s
|
S3_GW_HEALTHCHECK_TIMEOUT=15s
|
||||||
# Interval to check node health
|
# Interval to check node health
|
||||||
|
|
|
@ -100,8 +100,10 @@ tracing:
|
||||||
|
|
||||||
# Timeout to connect to a node
|
# Timeout to connect to a node
|
||||||
connect_timeout: 10s
|
connect_timeout: 10s
|
||||||
# Timeout for individual operations in streaming RPC.
|
# Timeout for individual operations in object pool streaming RPC.
|
||||||
stream_timeout: 10s
|
stream_timeout: 10s
|
||||||
|
# Timeout for individual operations in tree pool streaming RPC.
|
||||||
|
tree_stream_timeout: 10s
|
||||||
# Timeout to check node health during rebalance
|
# Timeout to check node health during rebalance
|
||||||
healthcheck_timeout: 15s
|
healthcheck_timeout: 15s
|
||||||
# Interval to check node health
|
# Interval to check node health
|
||||||
|
|
|
@ -215,6 +215,7 @@ resolve_order:
|
||||||
|
|
||||||
connect_timeout: 10s
|
connect_timeout: 10s
|
||||||
stream_timeout: 10s
|
stream_timeout: 10s
|
||||||
|
tree_stream_timeout: 10s
|
||||||
healthcheck_timeout: 15s
|
healthcheck_timeout: 15s
|
||||||
rebalance_interval: 60s
|
rebalance_interval: 60s
|
||||||
pool_error_threshold: 100
|
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). |
|
| `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`. |
|
| `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. |
|
| `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. |
|
| `healthcheck_timeout` | `duration` | no | `15s` | Timeout to check node health during rebalance. |
|
||||||
| `rebalance_interval` | `duration` | no | `60s` | Interval to check node health. |
|
| `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. |
|
| `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