1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-14 23:44:58 +02:00

Retry all S3 5xx errors rather than just 500 internal errors.

We were already retrying 500 errors but 503 (rate-limiting) errors were not being retried and would cause an instant failure which aborted the command.

There are only two 5xx errors currently implemented by S3 but instead of adding 503 simply retry all 5xx errors. This is consistent with the http definition of this error class, "the server failed to fulfill an apparently valid request."

Suggested by Craig A. James.
This commit is contained in:
David Steele
2018-10-30 16:45:42 -04:00
parent 286f7e5011
commit cca7a4ffd4
4 changed files with 26 additions and 10 deletions

View File

@ -166,12 +166,18 @@ sub run
$self->httpsServerAccept();
$self->httpsServerResponse(500);
$self->httpsServerAccept();
$self->httpsServerResponse(500);
$self->httpsServerAccept();
$self->httpsServerResponse(500);
});
#---------------------------------------------------------------------------------------------------------------------------
$self->testResult(sub {$oS3Request->request(HTTP_VERB_GET)}, undef, 'successful request after retries');
$self->testException(
sub {$oS3Request->request(HTTP_VERB_GET)}, ERROR_PROTOCOL, 'S3 request error after retries \[500\] GenericMessage.*');
sub {$oS3Request->request(HTTP_VERB_GET)}, ERROR_PROTOCOL, 'S3 request error after 5 tries \[500\] GenericMessage.*');
}
}