Stop Redis server lifecycle tasks - #13
Open
jbaxendale-ut wants to merge 1 commit into
Open
Conversation
The server creates a dispatcher, a delayed-job promoter, and a heartbeat worker, but previously stopped only its dispatcher. In long-running application processes that can leave background Redis work running after service shutdown. Track the maintenance tasks explicitly, make their starts idempotent, and stop them with the server. This gives every host a complete lifecycle boundary while preserving the existing at-least-once recovery model for pending jobs. Signed-off-by: Jeff Baxendale <jbaxendale@usertesting.com>
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.
The Redis server starts a dispatcher, delayed-job promoter, and heartbeat/recovery worker, but previously stopped only the dispatcher. This could leave Redis maintenance work running after a host considered the server shut down.
Track the maintenance tasks explicitly, make their starts idempotent, and stop them as part of the server lifecycle. Workers are stopped before heartbeat protection so pending jobs remain recoverable under the existing at-least-once delivery model.
Disclaimer: developed with the help of Codex as I was investigating latency issues in an LLM-moderated interview flow in our application. Let me know if this seems in appropriate, but wanted to offer my changes (running in production now) upstream see also socketry/async-job-adapter-active_job#29
General lifecycle concern for any host that starts and stops a Redis processor. A server should own—and fully stop—the background work it creates.
Types of Changes
Contribution