Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/aws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,15 @@ impl ObjectStore for AmazonS3 {
implementer: self.to_string(),
}),
(PutMode::Create, S3ConditionalPut::ETagMatch) => {
match request.header(&IF_NONE_MATCH, "*").do_put().await {
match request
.header(&IF_NONE_MATCH, "*")
// Real S3 can report 409 Conflict when a concurrent delete
// of the key completes before this write does. Nothing was
// written in that case, so the request is safe to retry.
.retry_on_conflict(true)
.do_put()
.await
{
// Technically If-None-Match should return NotModified but some stores,
// such as R2, instead return PreconditionFailed
// https://developers.cloudflare.com/r2/api/s3/extensions/#conditional-operations-in-putobject
Expand Down