Skip to content

Retry S3Hook.delete_bucket when a late write leaves bucket non-empty - #73930

Merged
vincbeck merged 1 commit into
apache:mainfrom
aws-mwaa:ghaeli/s3-delete-bucket-retry
Sep 30, 2026
Merged

vincbeck merged 1 commit into
apache:mainfrom
aws-mwaa:ghaeli/s3-delete-bucket-retry

Conversation

@seanghaeli

@seanghaeli seanghaeli commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #31192: S3Hook.delete_bucket(force_delete=True) retried emptying the bucket but called DeleteBucket only once afterwards, so an object written in between failed the delete with BucketNotEmpty. This includes the DeleteBucket call in the existing retry loop, so a BucketNotEmpty there re-empties the bucket and tries again.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (claude-fable-5) following the guidelines


@boring-cyborg boring-cyborg Bot added area:providers provider:amazon AWS/Amazon - related issues labels Sep 29, 2026
With force_delete, the retries only covered emptying the bucket. An object
that lands after the final empty listing (for example a service still
uploading logs) made DeleteBucket fail with BucketNotEmpty and nothing
retried it.
@seanghaeli
seanghaeli force-pushed the ghaeli/s3-delete-bucket-retry branch from 68cd7a4 to 7de86e7 Compare September 29, 2026 23:38
@seanghaeli
seanghaeli marked this pull request as ready for review September 29, 2026 23:58
@vincbeck
vincbeck merged commit e15b3a6 into apache:main Sep 30, 2026
125 of 157 checks passed
@vincbeck
vincbeck deleted the ghaeli/s3-delete-bucket-retry branch September 30, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants