mirror of https://github.com/apache/jclouds.git
Issue 71: retry on 400/RequestTimeout and 409/OperationAborted
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1495 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
9072a949d3
commit
83a2d93459
|
@ -60,13 +60,14 @@ public class AWSClientErrorRetryHandler implements HttpRetryHandler {
|
|||
public boolean shouldRetryRequest(HttpFutureCommand<?> command, HttpResponse response) {
|
||||
if (command.getFailureCount() > retryCountLimit)
|
||||
return false;
|
||||
if (response.getStatusCode() == 400) {
|
||||
if (response.getStatusCode() == 400 || response.getStatusCode() == 409) {
|
||||
byte[] content = S3Utils.closeConnectionButKeepContentStream(response);
|
||||
command.incrementRedirectCount();
|
||||
try {
|
||||
AWSError error = S3Utils.parseAWSErrorFromContent(parserFactory, command, response,
|
||||
new String(content));
|
||||
if ("RequestTimeout".equals(error.getCode())) {
|
||||
if ("RequestTimeout".equals(error.getCode())
|
||||
|| "OperationAborted".equals(error.getCode())) {
|
||||
return true;
|
||||
}
|
||||
} catch (HttpException e) {
|
||||
|
|
Loading…
Reference in New Issue