Repository navigation
Conversation
With if_match=None, S3Storage omitted IfMatch and did an unconditional PutObject. Two processes bootstrapping an empty key both read (b"", None) and both wrote, so the loser's first operation (e.g. an enqueue) was silently overwritten. InMemoryStorage, LocalFileSystemStorage and GCSStorage already treat if_match=None as "must not exist". Send IfNoneMatch="*" when if_match is None so S3 rejects the second creator with PreconditionFailed, and also map 409 ConditionalRequestConflict to CASConflictError. Document if_match=None as create-only in the port contract and README.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 3/9, base #4.
With
if_match=Nonethe S3 put was unconditional, so two processes creating the object could overwrite each other. Now sendsIfNoneMatch="*"and mapsConditionalRequestConflicttoCASConflictError.Tests:
test_write_without_if_match_is_create_only,test_racing_first_writes_second_gets_cas_conflict,test_racing_first_enqueues_both_survivefail on base;test_write_with_if_match_sends_condition,test_write_other_client_error_is_not_cas_conflictpass on both.