diff options
| author | Alexander Rutkovsky <[email protected]> | 2024-04-16 12:06:39 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-16 12:06:39 +0300 |
| commit | bf444b8ed4d0f6bf17fd753e2cf88f9440012e87 (patch) | |
| tree | dbf5d12995d216c9a19a45bab73f56a28722de66 | |
| parent | d7ca23dbee1457a777070e1fea0c513e3a5ae27d (diff) | |
Make interconnect proxy retry timeout parameters configurable (#3748)
4 files changed, 20 insertions, 6 deletions
diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp index d0dde48be51..188e6f9f722 100644 --- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp +++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp @@ -538,6 +538,16 @@ static TInterconnectSettings GetInterconnectSettings(const NKikimrConfig::TInter } result.SocketBacklogSize = config.GetSocketBacklogSize(); + if (config.HasFirstErrorSleep()) { + result.FirstErrorSleep = DurationFromProto(config.GetFirstErrorSleep()); + } + if (config.HasMaxErrorSleep()) { + result.MaxErrorSleep = DurationFromProto(config.GetMaxErrorSleep()); + } + if (config.HasErrorSleepRetryMultiplier()) { + result.ErrorSleepRetryMultiplier = config.GetErrorSleepRetryMultiplier(); + } + return result; } diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index f1abf422526..c24c9956047 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -423,6 +423,10 @@ message TInterconnectConfig { optional NKikimrConfigUnits.TDuration LostConnectionDuration = 28; optional NKikimrConfigUnits.TDuration BatchPeriodDuration = 29; + optional NKikimrConfigUnits.TDuration FirstErrorSleep = 46; + optional NKikimrConfigUnits.TDuration MaxErrorSleep = 47; + optional double ErrorSleepRetryMultiplier = 48; + optional uint32 OutgoingHandshakeInflightLimit = 43; } diff --git a/ydb/library/actors/interconnect/interconnect_common.h b/ydb/library/actors/interconnect/interconnect_common.h index 6d59c38a62f..fc23f70b531 100644 --- a/ydb/library/actors/interconnect/interconnect_common.h +++ b/ydb/library/actors/interconnect/interconnect_common.h @@ -51,6 +51,9 @@ namespace NActors { bool EnableExternalDataChannel = false; bool ValidateIncomingPeerViaDirectLookup = false; ui32 SocketBacklogSize = 0; // SOMAXCONN if zero + TDuration FirstErrorSleep = TDuration::MilliSeconds(10); + TDuration MaxErrorSleep = TDuration::Seconds(1); + double ErrorSleepRetryMultiplier = 4.0; ui32 GetSendBufferSize() const { ui32 res = 512 * 1024; // 512 kb is the default value for send buffer diff --git a/ydb/library/actors/interconnect/interconnect_tcp_proxy.cpp b/ydb/library/actors/interconnect/interconnect_tcp_proxy.cpp index c7b727e9ea2..0e1f95fd652 100644 --- a/ydb/library/actors/interconnect/interconnect_tcp_proxy.cpp +++ b/ydb/library/actors/interconnect/interconnect_tcp_proxy.cpp @@ -9,10 +9,6 @@ namespace NActors { static constexpr TDuration GetNodeRequestTimeout = TDuration::Seconds(5); - static constexpr TDuration FirstErrorSleep = TDuration::MilliSeconds(10); - static constexpr TDuration MaxErrorSleep = TDuration::Seconds(10); - static constexpr ui32 SleepRetryMultiplier = 4; - static TString PeerNameForHuman(ui32 nodeNum, const TString& longName, ui16 port) { TStringBuf token; TStringBuf(longName).NextTok('.', token); @@ -763,9 +759,10 @@ namespace NActors { // recalculate wakeup timeout -- if this is the first failure, then we sleep for default timeout; otherwise we // sleep N times longer than the previous try, but not longer than desired number of seconds + auto& s = Common->Settings; HoldByErrorWakeupDuration = HoldByErrorWakeupDuration != TDuration::Zero() - ? Min(HoldByErrorWakeupDuration * SleepRetryMultiplier, MaxErrorSleep) - : FirstErrorSleep; + ? Min(HoldByErrorWakeupDuration * s.ErrorSleepRetryMultiplier, s.MaxErrorSleep) + : Common->Settings.FirstErrorSleep; // transit to required state and arm wakeup timer if (Terminated) { |
