fix(storage): fix purge infinite loop and garbled errors on object-locked buckets#832
Merged
natalie-o-perret merged 4 commits intomasterfrom May 6, 2026
Merged
Conversation
- stop looping when no objects are deleted (e.g. compliance retention) - fix missing pagination in ListObjectVersions (KeyMarker/VersionIdMarker) - fix select race on closed deletedChan using nil-channel pattern
- ComplianceLock: verify goroutine exits after one failed batch instead of looping forever re-listing the same locked objects - Pagination: verify KeyMarker/VersionIdMarker are forwarded correctly on truncated responses - HappyPath: verify normal two-version delete works end-to-end
types.Error fields are all *string pointers; printing with %%v produces pointer addresses instead of the actual error details. Format them with aws.ToString to get the key, version, message and code.
Reproduces the bug where exo storage purge looped forever on a bucket with object lock enabled. Sets up a real bucket with GOVERNANCE retention via the aws CLI, uploads objects, then runs exo storage purge with a 10s deadline to catch the loop. Also asserts errors are human-readable (not raw pointer addresses). Cleanup bypasses GOVERNANCE retention so the bucket is removed after the test regardless of outcome.
9c970d4 to
464ee76
Compare
Contributor
Author
|
[SC-176386] |
pierre-emmanuelJ
approved these changes
May 6, 2026
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.
Problem
exo storage purgehangs forever on buckets with object lock enabled.3 bugs in
DeleteObjectVersions(pkg/storage/sos/object.go):Infinite loop: when
DeleteObjectsreturns HTTP 200 with per-object errors (objects are locked), theDeletedslice is empty. No progress check meant the loop kept re-listing and re-submitting the same objects forever.Garbled errors:
types.Errorhas*stringfields. Formatting with%vprinted raw pointer addresses instead of the actual message:Skipped pages:
ListObjectVersionsnever forwardedKeyMarker/VersionIdMarker, so only the first page of versions was processed.Fix
ListObjectVersionswithKeyMarker/VersionIdMarker.aws.ToString()on each*stringfield.cmd/storage_purge.go).Before
After
Tests
object_test.go).tests/integ/with-api/storage_purge_object_lock_test.go).End-to-end repro script (boto3, no aws CLI required)
Note
GitHub Copilot leveraged to: