提交 b7155ab1 编写于 作者: A Adam Lee

Revert "gpcloud: sleep and retry if AWS returns "NoSuchKey" error"

This reverts commit 668558dd.
上级 668558dd
......@@ -13,9 +13,6 @@ class S3Exception {
virtual ~S3Exception() {
}
virtual string getCode() {
return "";
}
virtual string getMessage() {
return "";
}
......@@ -131,10 +128,6 @@ class S3LogicError : public S3Exception {
}
virtual ~S3LogicError() {
}
virtual string getCode() {
return awscode;
}
virtual string getMessage() {
return "AWS returns error " + awscode + " : " + message;
}
......
......@@ -31,26 +31,13 @@ S3InterfaceService::~S3InterfaceService() {
Response S3InterfaceService::getResponseWithRetries(const string &url, HTTPHeaders &headers,
uint64_t retries) {
string code;
string message;
uint64_t retry = retries;
while (retry--) {
try {
return this->restfulService->get(url, headers);
} catch (S3Exception &e) {
if (e.getType() != "S3ConnectionError" || e.getType() != "S3LogicError") {
break;
}
code = e.getCode();
if (code == "NoSuchKey") {
sleep(1);
continue;
} else if (!code.empty()) {
break;
}
} catch (S3ConnectionError &e) {
message = e.getMessage();
if (S3QueryIsAbortInProgress()) {
S3_DIE(S3QueryAbort, "Downloading is interrupted");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册