Prerequisites
- WindowsAzure.Storage V 9.3.3
- Azure.Storage.Blobs V 12.6.0
- Datadog APM monitoring
Context:
- This is a known problem, that a blob client
CreateIfNotExists(Async)returns 409 during execution, in case if a container already has been created before - Due to existed implementation, the
CreateIfNotExistscheck is executing per a request, that mean a lot of times - As a result, there are a lot of 409 errors in a log & monitor systems
- Also, it's kind of challenge to move logic to the app root, and, thus, to avoid per request
CreateIfNotExistscheck
The possible fix, under consideration:
To mitigate the issue, I gonna to replace it with something like:
if (!await blobClient.ExistsAsync().ConfigureAwait(false))
{
await containerClient.CreateAsync().ConfigureAwait(false);
}
Question: And one moment that bothering me:
- Could be such replacement become a concern within high concurrent workflow ?
P.s I've looked into CreateIfNotExistsAsync implementation at 'Azure.Storage.Blobs' nuget. From my point of view, nothing special about concurrency, but maybe I'm wrong. Pls. share you experience
