[pbs-devel] [PATCH proxmox 3/3] fix #6858: s3-client: retry request on 500 and 503 response status
Christian Ebner
c.ebner at proxmox.com
Fri Jan 23 15:58:35 CET 2026
Follow the best practices for AWS S3 error handling [0] and perform
retries on requests with http status code 500 or 503 in the response.
This is done for all requests unconditionally, maximum number of
retires and optional request timeout being honored.
[0] https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorBestPractices.html
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6858
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
proxmox-s3-client/src/client.rs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/proxmox-s3-client/src/client.rs b/proxmox-s3-client/src/client.rs
index f3e5eb45..f8cae7da 100644
--- a/proxmox-s3-client/src/client.rs
+++ b/proxmox-s3-client/src/client.rs
@@ -389,7 +389,14 @@ impl S3Client {
};
match response {
- Ok(response) => return Ok(response),
+ Ok(response) => match response.status() {
+ StatusCode::INTERNAL_SERVER_ERROR | StatusCode::SERVICE_UNAVAILABLE => {
+ if retry >= MAX_S3_HTTP_REQUEST_RETRY - 1 {
+ bail!("request failed exceeding retries");
+ }
+ }
+ _ => return Ok(response),
+ },
Err(err) => {
if retry >= MAX_S3_HTTP_REQUEST_RETRY - 1 {
return Err(err.into());
--
2.47.3
More information about the pbs-devel
mailing list