Skip to content

[13.x] Optionally flush the SQS overflow store on queue:clear#60138

Merged
taylorotwell merged 3 commits into
laravel:13.xfrom
Orrison:sqs-overflow-cleanup
May 18, 2026
Merged

[13.x] Optionally flush the SQS overflow store on queue:clear#60138
taylorotwell merged 3 commits into
laravel:13.xfrom
Orrison:sqs-overflow-cleanup

Conversation

@Orrison
Copy link
Copy Markdown
Contributor

@Orrison Orrison commented May 15, 2026

Right now, queue:clear purges SQS but leaves the offloaded payloads sitting in the cache store. Even if a TTL got added later, when someone clears the queue, they may want the storage reclaimed now rather than waiting for expiration (matters especially on S3, where leftover objects keep costing money or persistence of payloads with sensitive data could be an issue).

Adds an opt-in flush_on_clear flag under the overflow config. When on, SqsQueue::clear() calls flush() on the configured cache store after purging SQS. Defaults to off.

Worth flagging: for most cache stores flush() wipes the whole store, not just the overflow entries. I considered some options to narrow its scope. Like tags or maybe a manifest file/entry pattern. Tags didn't seem right (though maybe that is still an option), and a manifest adds per-push overhead and concurrency issues that felt heavier than the feature needs. So this is opt-in and separate from delete_after_processing, with the recommendation to point overflow.store at a dedicated cache store (the new storage driver with its own disk and/or path is a clean fit).

Tests cover flush runs when enabled, don't run when disabled or when overflow is off, and forward the configured store name.

Has any user-facing documentation been written for the overflow feature yet? Happy to put together a docs PR if not.

@github-actions
Copy link
Copy Markdown

Thanks for submitting a PR!

Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@Orrison Orrison force-pushed the sqs-overflow-cleanup branch 3 times, most recently from b26cb51 to 59c5d26 Compare May 15, 2026 19:10
@Orrison Orrison marked this pull request as ready for review May 15, 2026 19:15
Orrison added 3 commits May 17, 2026 20:14
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
@Orrison Orrison force-pushed the sqs-overflow-cleanup branch from 59c5d26 to bd17a8e Compare May 18, 2026 00:14
@taylorotwell taylorotwell merged commit 864c94b into laravel:13.x May 18, 2026
52 checks passed
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