@@ -204,6 +204,8 @@ class TS3ApplicatorActor;
204
204
using TObjectStorageRequest = std::function<void (TS3ApplicatorActor& actor)>;
205
205
206
206
class TS3ApplicatorActor : public NActors ::TActorBootstrapped<TS3ApplicatorActor> {
207
+ static constexpr ui64 GLOBAL_RETRY_LIMIT = 100 ;
208
+
207
209
public:
208
210
using NActors::TActorBootstrapped<TS3ApplicatorActor>::Send;
209
211
@@ -230,7 +232,7 @@ class TS3ApplicatorActor : public NActors::TActorBootstrapped<TS3ApplicatorActor
230
232
, ExternalEffect(externalEffect)
231
233
, ActorSystem(NActors::TActivationContext::ActorSystem())
232
234
, RetryPolicy(NYql::GetHTTPDefaultRetryPolicy(TDuration::Zero(), 3 ))
233
- , RetryCount(100 ) {
235
+ , RetryCount(GLOBAL_RETRY_LIMIT ) {
234
236
// ^^^ 3 retries in HTTP GW per operation
235
237
// up to 100 retries at app level for all operations ^^^
236
238
}
@@ -271,12 +273,15 @@ class TS3ApplicatorActor : public NActors::TActorBootstrapped<TS3ApplicatorActor
271
273
hFunc (TEvPrivate::TEvListParts, Handle );
272
274
)
273
275
274
- bool RetryOperation (CURLcode curlResponseCode, ui32 httpResponseCode) {
276
+ bool RetryOperation (CURLcode curlResponseCode, ui32 httpResponseCode, const TString& url, const TString& operationName ) {
275
277
auto result = RetryCount && RetryPolicy->CreateRetryState ()->GetNextRetryDelay (curlResponseCode, httpResponseCode);
278
+ Issues.AddIssue (TStringBuilder () << " Retry operation " << operationName << " , curl error: " << curl_easy_strerror (curlResponseCode) << " , http code: " << httpResponseCode << " , url: " << url);
276
279
if (result) {
277
280
RetryCount--;
278
281
} else {
279
- Finish (true );
282
+ Finish (true , RetryCount
283
+ ? TString (" Number of retries exceeded limit per operation" )
284
+ : TStringBuilder () << " Number of retries exceeded global limit in " << GLOBAL_RETRY_LIMIT << " retries" );
280
285
}
281
286
return result;
282
287
}
@@ -370,8 +375,9 @@ class TS3ApplicatorActor : public NActors::TActorBootstrapped<TS3ApplicatorActor
370
375
return ;
371
376
}
372
377
}
373
- LOG_D (" CommitMultipartUpload ERROR " << ev->Get ()->State ->BuildUrl ());
374
- if (RetryOperation (result.CurlResponseCode , result.Content .HttpResponseCode )) {
378
+ const TString& url = ev->Get ()->State ->BuildUrl ();
379
+ LOG_D (" CommitMultipartUpload ERROR " << url);
380
+ if (RetryOperation (result.CurlResponseCode , result.Content .HttpResponseCode , url, " CommitMultipartUpload" )) {
375
381
PushCommitMultipartUpload (ev->Get ()->State );
376
382
}
377
383
}
@@ -444,8 +450,9 @@ class TS3ApplicatorActor : public NActors::TActorBootstrapped<TS3ApplicatorActor
444
450
}
445
451
return ;
446
452
}
447
- LOG_D (" ListMultipartUploads ERROR " << ev->Get ()->State ->BuildUrl ());
448
- if (RetryOperation (result.CurlResponseCode , result.Content .HttpResponseCode )) {
453
+ const TString& url = ev->Get ()->State ->BuildUrl ();
454
+ LOG_D (" ListMultipartUploads ERROR " << url);
455
+ if (RetryOperation (result.CurlResponseCode , result.Content .HttpResponseCode , url, " ListMultipartUploads" )) {
449
456
PushListMultipartUploads (ev->Get ()->State );
450
457
}
451
458
}
@@ -467,8 +474,9 @@ class TS3ApplicatorActor : public NActors::TActorBootstrapped<TS3ApplicatorActor
467
474
return ;
468
475
}
469
476
}
470
- LOG_D (" AbortMultipartUpload ERROR " << ev->Get ()->State ->BuildUrl ());
471
- if (RetryOperation (result.CurlResponseCode , result.Content .HttpResponseCode )) {
477
+ const TString& url = ev->Get ()->State ->BuildUrl ();
478
+ LOG_D (" AbortMultipartUpload ERROR " << url);
479
+ if (RetryOperation (result.CurlResponseCode , result.Content .HttpResponseCode , url, " AbortMultipartUpload" )) {
472
480
PushAbortMultipartUpload (ev->Get ()->State );
473
481
}
474
482
}
@@ -507,8 +515,9 @@ class TS3ApplicatorActor : public NActors::TActorBootstrapped<TS3ApplicatorActor
507
515
}
508
516
return ;
509
517
}
510
- LOG_D (" ListParts ERROR " << ev->Get ()->State ->BuildUrl ());
511
- if (RetryOperation (result.CurlResponseCode , result.Content .HttpResponseCode )) {
518
+ const TString& url = ev->Get ()->State ->BuildUrl ();
519
+ LOG_D (" ListParts ERROR " << url);
520
+ if (RetryOperation (result.CurlResponseCode , result.Content .HttpResponseCode , url, " ListParts" )) {
512
521
PushListParts (ev->Get ()->State );
513
522
}
514
523
}
0 commit comments