-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for Container.CreateIfNotExist HTTP status 409 #51
Conversation
Correcting an error in the storage client when CreateIfNotExists sometimes returns 409 status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @odysseus1973
Good catch!
Please see my comments. Once those are addressed, this is good to go (I'll backport and release a patch).
@@ -48,7 +48,11 @@ public override async Task<Message> BeforeMessageSend(Message message) | |||
await InitializeClient().ConfigureAwait(false); | |||
|
|||
var container = client.GetContainerReference(configuration.ContainerName); | |||
await container.CreateIfNotExistsAsync().ConfigureAwait(false); | |||
|
|||
if (! await container.ExistsAsync()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ConfigureAwait(false)
is missing
@@ -139,7 +143,11 @@ public override async Task<Message> AfterMessageReceive(Message message) | |||
await InitializeClient().ConfigureAwait(false); | |||
|
|||
var container = client.GetContainerReference(configuration.ContainerName); | |||
await container.CreateIfNotExistsAsync().ConfigureAwait(false); | |||
|
|||
if (! await container.ExistsAsync()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ConfigureAwait(false)
is missing
Thank you @odysseus1973 |
CreateIfNotExists()
can fail with code 409 which represents more than one state (similar to Tables)TableAlreadyExists
orTableBeingDeleted
This is an issue with the Storage Table SDK with a workaround implemented in this PR.
Original description
Correcting an error in the storage client when CreateIfNotExists sometimes returns 409 status