[BUG] using OpenWriteAsync with BlockBlobClient does not seems to reuse the BlobClientOptions.Retry options
See original GitHub issueLibrary name and version
Azure.Storage.Blobs 12.13.0
Describe the bug
I’m using BlobClientOptions to add a different retry. It does not seem to be applied to the BlockBlobClient.
public async Task UploadToBlobAsync(string blobSasUrl, Stream sourceStream, CancellationToken cancellationToken)
{
BlockBlobClient blob = new(new Uri(blobSasUrl), new BlobClientOptions
{
Retry =
{
Mode = RetryMode.Fixed,
MaxRetries = 120,
Delay = TimeSpan.FromMilliseconds(500),
MaxDelay = TimeSpan.FromMilliseconds(5000)
}
});
using Stream blobStream = await blob.OpenWriteAsync(true, null, cancellationToken);
await sourceStream.CopyToAsync(blobStream, cancellationToken);
}
Expected behavior
I would expect to have 120 retries in the log and to have 500 ms between them.
Actual behavior
It seems to have only 4 retries with a very short period of time.
Reproduction Steps
I created a URL with Sas token and I’m trying to upload it. (Not the same service as the one creating it)
Environment
Dotnet 6.0, in a container
Issue Analytics
- State:
- Created a year ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Implement a retry policy using the Azure Storage client ...
In this code example for blob storage, we'll configure the retry options in the Retry property of the BlobClientOptions class. Then, we'll ...
Read more >BlockBlobClient.OpenWriteAsync Method - Storage
Opens a stream for writing to the blob. If the blob exists, it will be overwritten.
Read more >Azure Storage SDK for .NET: How to set RetryPolicy on ...
One set the retry policy when creating BlobServiceClient : var blobServiceClient = new BlobServiceClient (connectionString: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there any way to just override the stream return to retry on this specific error?
amnguye
How do you detect that the policy is now valid without blindly waiting 30 seconds?