Skip to content
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

Merged
merged 2 commits into from
Aug 7, 2018

Conversation

odysseus1973
Copy link
Contributor

@odysseus1973 odysseus1973 commented Aug 7, 2018

CreateIfNotExists() can fail with code 409 which represents more than one state (similar to Tables)

  • TableAlreadyExists or
  • TableBeingDeleted

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

Correcting an error in the storage client when CreateIfNotExists sometimes returns 409 status
@SeanFeldman
Copy link
Owner

Copy link
Owner

@SeanFeldman SeanFeldman left a 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())
Copy link
Owner

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())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ConfigureAwait(false) is missing

@SeanFeldman SeanFeldman changed the title Fix for 409 http status Fix for Container.CreateIfNotExist HTTP status 409 Aug 7, 2018
@SeanFeldman SeanFeldman added this to the 3.0.0-alpha0003 milestone Aug 7, 2018
@SeanFeldman
Copy link
Owner

@SeanFeldman SeanFeldman merged commit 31846c8 into SeanFeldman:develop Aug 7, 2018
@SeanFeldman
Copy link
Owner

Thank you @odysseus1973
This will be going out as 3.0.0-alpha0003 and backported to 2.2.2.

@SeanFeldman SeanFeldman modified the milestones: 3.0.0-alpha0003, 3.0.0 Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants