From b7f26937f148c0731dad804994c85c3bae5709f2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 25 Feb 2025 10:16:04 +0000 Subject: [PATCH] azureblob: fix errors not being retried when doing single part copy Sometimes the Azure blob servers reply with 503 ServerBusy errors and these should be retried. Before this change, when testing to see if a single part server side copy was done, ServerBusy errors were returned to the user rather than being retried. Wrapping the call in the pacer fixes the problem and ensures it is retried properly using the --low-level-retries mechanism. --- backend/azureblob/azureblob.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go index c2db11267..4c7f2791e 100644 --- a/backend/azureblob/azureblob.go +++ b/backend/azureblob/azureblob.go @@ -1888,7 +1888,11 @@ func (f *Fs) copySinglepart(ctx context.Context, remote, dstContainer, dstPath s pollTime := 100 * time.Millisecond for copyStatus != nil && string(*copyStatus) == string(container.CopyStatusTypePending) { time.Sleep(pollTime) - getMetadata, err := dstBlobSVC.GetProperties(ctx, &getOptions) + var getMetadata blob.GetPropertiesResponse + err = f.pacer.Call(func() (bool, error) { + getMetadata, err = dstBlobSVC.GetProperties(ctx, &getOptions) + return f.shouldRetry(ctx, err) + }) if err != nil { return nil, err }