Skip to content

fix: make empty bucket use queue to remove underlying objects asynchronously #701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

itslenny
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

When a bucket is emptied it sends DeleteObjectsCommand to S3 in a tight loop resulting in rate limit errors and ultimately orphan objects.

What is the new behavior?

Use the queue to delete objects from the underlying object store asynchronously

Additional context

The ObjectAdminDeleteBatch event is directly copied from ObjectAdminDelete the only difference being that it takes a list of prefixes to be passed directly into storage.backend.deleteObjects(...) which maintains the same behavior for empty bucket as before the change, but utilizes the queue if available.

@itslenny itslenny marked this pull request as ready for review May 30, 2025 18:06
@itslenny itslenny force-pushed the fix/use-queue-in-empty-to-delete-objects branch from 1904a35 to 1d91784 Compare May 30, 2025 18:13
@coveralls
Copy link

coveralls commented May 30, 2025

Pull Request Test Coverage Report for Build 15352985493

Details

  • 68 of 100 (68.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 78.127%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/workers.ts 1 2 50.0%
src/storage/events/object-admin-delete-batch.ts 58 89 65.17%
Totals Coverage Status
Change from base Build 15298566839: -0.03%
Covered Lines: 17391
Relevant Lines: 22089

💛 - Coveralls

@itslenny itslenny force-pushed the fix/use-queue-in-empty-to-delete-objects branch from 3c757e7 to d4c173d Compare June 5, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants