Skip to content

Commit 0ad6717

Browse files
committed
add bvar
1 parent fb0a1ff commit 0ad6717

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cloud/src/recycler/s3_accessor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <aws/core/auth/AWSCredentials.h>
2222
#include <aws/core/client/DefaultRetryStrategy.h>
2323
#include <aws/s3/S3Client.h>
24+
#include <bvar/reducer.h>
2425
#include <gen_cpp/cloud.pb.h>
2526

2627
#include <algorithm>
@@ -42,6 +43,9 @@
4243
#include "recycler/storage_vault_accessor.h"
4344

4445
namespace {
46+
47+
bvar::Adder<uint64_t> too_many_request_http_retry_times("too_many_request_http_retry_times");
48+
4549
class CustomRetryStrategy final : public Aws::Client::DefaultRetryStrategy {
4650
public:
4751
CustomRetryStrategy(int maxRetries) : DefaultRetryStrategy(maxRetries) {}
@@ -50,6 +54,7 @@ class CustomRetryStrategy final : public Aws::Client::DefaultRetryStrategy {
5054
long attemptedRetries) const override {
5155
if (attemptedRetries < m_maxRetries &&
5256
error.GetResponseCode() == Aws::Http::HttpResponseCode::TOO_MANY_REQUESTS) {
57+
too_many_request_http_retry_times << 1;
5358
return true;
5459
}
5560
return Aws::Client::DefaultRetryStrategy::ShouldRetry(error, attemptedRetries);

0 commit comments

Comments
 (0)