@@ -289,6 +289,7 @@ class TKesusQuoterProxy : public TActorBootstrapped<TKesusQuoterProxy> {
289
289
bool Connected = false ;
290
290
TInstant DisconnectTime;
291
291
ui64 OfflineAllocationCookie = 0 ;
292
+ ui64 KesusReconnectCount = 0 ;
292
293
293
294
TMap<TString, THolder<TResourceState>> Resources; // Map because iterators are needed to remain valid during insertions.
294
295
THashMap<ui64, decltype (Resources)::iterator> ResIndex;
@@ -803,7 +804,11 @@ class TKesusQuoterProxy : public TActorBootstrapped<TKesusQuoterProxy> {
803
804
SendToService (CreateUpdateEvent (TEvQuota::EUpdateState::Broken));
804
805
} else {
805
806
KESUS_PROXY_LOG_WARN (" Failed to connect to tablet. Status: " << ev->Get ()->Status );
806
- ConnectToKesus (true );
807
+ if (!ConnectToKesus (true )) {
808
+ KESUS_PROXY_LOG_WARN (" Too many reconnect attempts, assuming kesus dead" );
809
+ SendToService (CreateUpdateEvent (TEvQuota::EUpdateState::Broken));
810
+ KesusReconnectCount = 0 ;
811
+ }
807
812
}
808
813
}
809
814
}
@@ -1119,7 +1124,6 @@ class TKesusQuoterProxy : public TActorBootstrapped<TKesusQuoterProxy> {
1119
1124
1120
1125
NTabletPipe::TClientConfig GetPipeConnectionOptions (bool reconnection) {
1121
1126
NTabletPipe::TClientConfig cfg;
1122
- cfg.CheckAliveness = true ;
1123
1127
cfg.RetryPolicy = {
1124
1128
.RetryLimitCount = 3u ,
1125
1129
.DoFirstRetryInstantly = !reconnection
@@ -1134,9 +1138,13 @@ class TKesusQuoterProxy : public TActorBootstrapped<TKesusQuoterProxy> {
1134
1138
CookieToResourcePath.clear (); // we will resend all requests with new cookies
1135
1139
}
1136
1140
1137
- void ConnectToKesus (bool reconnection) {
1141
+ bool ConnectToKesus (bool reconnection) {
1138
1142
if (reconnection) {
1139
1143
KESUS_PROXY_LOG_INFO (" Reconnecting to kesus" );
1144
+ ++KesusReconnectCount;
1145
+ if (KesusReconnectCount > 5 ) {
1146
+ return false ;
1147
+ }
1140
1148
} else {
1141
1149
KESUS_PROXY_LOG_DEBUG (" Connecting to kesus" );
1142
1150
}
@@ -1149,6 +1157,7 @@ class TKesusQuoterProxy : public TActorBootstrapped<TKesusQuoterProxy> {
1149
1157
GetKesusTabletId (),
1150
1158
GetPipeConnectionOptions (reconnection)));
1151
1159
Connected = false ;
1160
+ return true ;
1152
1161
}
1153
1162
1154
1163
void PassAway () override {
0 commit comments