[pbs-devel] [PATCH proxmox v3 1/2] s3-client: add exponential backoff time for upload retries

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Oct 27 15:10:35 CET 2025


On October 15, 2025 6:39 pm, Christian Ebner wrote:
> With the main purpose to backoff some time in case of concurrent
> conditional uploads with the If-None-Match header is set. For these,
> the upload will fail with http status code 409 as stated in  [0]. The
> backoff time will increase the time window for the already ongoing
> upload to finish.
> 
> [0] https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_RequestSyntax
> 
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
>  proxmox-s3-client/src/client.rs | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/proxmox-s3-client/src/client.rs b/proxmox-s3-client/src/client.rs
> index abb35f2f..4ebd8c4b 100644
> --- a/proxmox-s3-client/src/client.rs
> +++ b/proxmox-s3-client/src/client.rs
> @@ -715,6 +715,10 @@ impl S3Client {
>              .max(S3_HTTP_REQUEST_TIMEOUT.as_secs());
>          let timeout = Some(Duration::from_secs(timeout_secs));
>          for retry in 0..MAX_S3_UPLOAD_RETRY {
> +            if retry > 0 {
> +                let backoff_secs = S3_HTTP_REQUEST_RETRY_BACKOFF_DEFAULT * 3_u32.pow(retry as u32);
> +                tokio::time::sleep(backoff_secs).await;
> +            }

should we move this to the PubObjectResponse::NeedsRetry handling, to
ensure the exponential backoff only triggers for that particular error
path? or do you think other generic error conditions would also benefit
from it?

>              let body = Body::from(object_data.clone());
>              match self
>                  .put_object(object_key.clone(), body, timeout, replace)
> -- 
> 2.47.3
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 




More information about the pbs-devel mailing list