forked from TrueCloudLab/frostfs-node
[#422] pkg/services: Provide client options on cache creation
Because options are not used when client is already in cache providing them to shared cache is misleading at best. In the worst case `dial_timeout` is set randomly (because of race condition) which can lead to one service having `dial_timeout` of another. Thus we set default client creation options when cache is created. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
cc7287d6f7
commit
6679d59e89
13 changed files with 22 additions and 79 deletions
|
@ -67,6 +67,7 @@ const (
|
|||
cfgListenAddress = "grpc.endpoint"
|
||||
cfgMaxMsgSize = "grpc.maxmessagesize"
|
||||
cfgReflectService = "grpc.enable_reflect_service"
|
||||
cfgDialTimeout = "grpc.dial_timeout"
|
||||
|
||||
// config keys for cfgMorph
|
||||
cfgMorphRPCAddress = "morph.rpc_endpoint"
|
||||
|
@ -93,10 +94,8 @@ const (
|
|||
cfgPolicerWorkScope = "policer.work_scope"
|
||||
cfgPolicerExpRate = "policer.expansion_rate"
|
||||
cfgPolicerHeadTimeout = "policer.head_timeout"
|
||||
cfgPolicerDialTimeout = "policer.dial_timeout"
|
||||
|
||||
cfgReplicatorPutTimeout = "replicator.put_timeout"
|
||||
cfgReplicatorDialTimeout = "replicator.dial_timeout"
|
||||
cfgReplicatorPutTimeout = "replicator.put_timeout"
|
||||
|
||||
cfgReBootstrapEnabled = "bootstrap.periodic.enabled"
|
||||
cfgReBootstrapInterval = "bootstrap.periodic.interval"
|
||||
|
@ -107,13 +106,6 @@ const (
|
|||
cfgObjectSearchPoolSize = "pool.object.search.size"
|
||||
cfgObjectRangePoolSize = "pool.object.range.size"
|
||||
cfgObjectRangeHashPoolSize = "pool.object.rangehash.size"
|
||||
|
||||
cfgObjectPutDialTimeout = "object.put.dial_timeout"
|
||||
cfgObjectHeadDialTimeout = "object.head.dial_timeout"
|
||||
cfgObjectRangeDialTimeout = "object.range.dial_timeout"
|
||||
cfgObjectRangeHashDialTimeout = "object.rangehash.dial_timeout"
|
||||
cfgObjectSearchDialTimeout = "object.search.dial_timeout"
|
||||
cfgObjectGetDialTimeout = "object.get.dial_timeout"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -401,6 +393,7 @@ func defaultConfiguration(v *viper.Viper) {
|
|||
v.SetDefault(cfgListenAddress, "127.0.0.1:50501") // listen address
|
||||
v.SetDefault(cfgMaxMsgSize, 4<<20) // transport msg limit 4 MiB
|
||||
v.SetDefault(cfgReflectService, false)
|
||||
v.SetDefault(cfgDialTimeout, 5*time.Second)
|
||||
|
||||
v.SetDefault(cfgAccountingContract, "1aeefe1d0dfade49740fff779c02cd4a0538ffb1")
|
||||
v.SetDefault(cfgAccountingFee, "1")
|
||||
|
@ -428,10 +421,8 @@ func defaultConfiguration(v *viper.Viper) {
|
|||
v.SetDefault(cfgPolicerWorkScope, 100)
|
||||
v.SetDefault(cfgPolicerExpRate, 10) // in %
|
||||
v.SetDefault(cfgPolicerHeadTimeout, 5*time.Second)
|
||||
v.SetDefault(cfgPolicerDialTimeout, 5*time.Second)
|
||||
|
||||
v.SetDefault(cfgReplicatorPutTimeout, 5*time.Second)
|
||||
v.SetDefault(cfgReplicatorDialTimeout, 5*time.Second)
|
||||
|
||||
v.SetDefault(cfgReBootstrapEnabled, false) // in epochs
|
||||
v.SetDefault(cfgReBootstrapInterval, 2) // in epochs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue