aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilnaz <ilnaz@ydb.tech>2022-09-16 15:21:06 +0300
committerilnaz <ilnaz@ydb.tech>2022-09-16 15:21:06 +0300
commite627a759adbd8b9cb75c9e6215f1793a7b52e73f (patch)
tree8ea8e2762fa20ee6f65f42953d57d2abbc217cdf
parent97475a8905bc20045b5157a38f3cd7d7793b67ac (diff)
downloadydb-e627a759adbd8b9cb75c9e6215f1793a7b52e73f.tar.gz
Retry TooManyRequests
-rw-r--r--ydb/core/tx/datashard/export_s3_base_uploader.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/ydb/core/tx/datashard/export_s3_base_uploader.h b/ydb/core/tx/datashard/export_s3_base_uploader.h
index 8e2c6f8a030..1acce848bc4 100644
--- a/ydb/core/tx/datashard/export_s3_base_uploader.h
+++ b/ydb/core/tx/datashard/export_s3_base_uploader.h
@@ -315,8 +315,20 @@ protected:
return false;
}
+ static bool ShouldRetry(const Aws::S3::S3Error& error) {
+ if (error.ShouldRetry()) {
+ return true;
+ }
+
+ if ("TooManyRequests" == error.GetExceptionName()) {
+ return true;
+ }
+
+ return false;
+ }
+
void RetryOrFinish(const Aws::S3::S3Error& error) {
- if (Attempt++ < Retries && error.ShouldRetry()) {
+ if (Attempt++ < Retries && ShouldRetry(error)) {
Delay = Min(Delay * Attempt, TDuration::Minutes(10));
const TDuration random = TDuration::FromValue(TAppData::RandomProvider->GenRand64() % Delay.MicroSeconds());