MCPcopy Create free account
hub / github.com/apache/cloudberry / getResponseWithRetries

Method getResponseWithRetries

gpcontrib/gpcloud/src/s3interface.cpp:32–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32Response S3InterfaceService::getResponseWithRetries(const string &url, HTTPHeaders &headers,
33 uint64_t retries) {
34 string code;
35 string message;
36 uint64_t retry = retries;
37
38 while (retry--) {
39 try {
40 return this->restfulService->get(url, headers);
41 } catch (S3ConnectionError &e) {
42 message = e.getMessage();
43 if (S3QueryIsAbortInProgress()) {
44 S3_DIE(S3QueryAbort, "Downloading is interrupted");
45 }
46 S3WARN("Failed to get a good response in GET from '%s', retrying ...", url.c_str());
47 } catch (S3LogicError &e) {
48 code = e.getCode();
49 if (code == "NoSuchKey") {
50 sleep(1);
51 continue;
52 } else {
53 throw e;
54 }
55 }
56 };
57
58 S3_DIE(S3FailedAfterRetry, url, retries, message);
59};
60
61Response S3InterfaceService::putResponseWithRetries(const string &url, HTTPHeaders &headers,
62 S3VectorUInt8 &data, uint64_t retries) {

Callers 4

getBucketResponseMethod · 0.95
fetchDataMethod · 0.95
checkCompressionTypeMethod · 0.95
TEST_FFunction · 0.80

Calls 4

S3QueryIsAbortInProgressFunction · 0.70
getMethod · 0.45
getMessageMethod · 0.45
getCodeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64