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) {
|
||||
|
|
|
@ -93,7 +93,7 @@ public class ParseSax<T> extends HttpFutureCommand.ResponseCallable<T> {
|
|||
IOUtils.closeQuietly(xml);
|
||||
xml = IOUtils.toInputStream(response);
|
||||
}
|
||||
InputSource input = new InputSource(new InputStreamReader(xml,"UTF-8"));
|
||||
InputSource input = new InputSource(new InputStreamReader(xml, "UTF-8"));
|
||||
parser.parse(input);
|
||||
} catch (Exception e) {
|
||||
StringBuilder message = new StringBuilder();
|
||||
|
|
Loading…
Reference in New Issue