mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-01 19:12:14 +00:00
f5348d5cc4
A streaming GET holds snapshot leases on the object's data directories, and DeleteObjects defers their physical cleanup until the leases are released. A DeleteBucket issued inside that window passes the xl.meta emptiness check but fails closed in the non-force delete_volume tree removal on the leftover part files, returning BucketNotEmpty for a logically empty bucket. This is what intermittently failed the s3tests test_encryption_sse_c_multipart_bad_download teardown in CI: the test never reads its 30MiB GET body, so the server-side stream (and its leases) stays alive until the connection drops, racing the teardown's DeleteObjects + DeleteBucket sequence. With the body held open the failure reproduces 5/5 locally; after this change it passes 20/20, and the real s3-tests case passes 20 consecutive runs. delete_volume now executes the registry-tracked pending deferred deletions for the volume before removing the directory tree. Only data dirs whose logical delete already committed are touched; unknown files still fail closed with VolumeNotEmpty.