Skip to content

Stop Redis server lifecycle tasks - #13

Open
jbaxendale-ut wants to merge 1 commit into
socketry:mainfrom
user-interviews:fix/server-lifecycle-shutdown
Open

Stop Redis server lifecycle tasks#13
jbaxendale-ut wants to merge 1 commit into
socketry:mainfrom
user-interviews:fix/server-lifecycle-shutdown

Conversation

@jbaxendale-ut

@jbaxendale-ut jbaxendale-ut commented Sep 3, 2026

Copy link
Copy Markdown

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

  • Bug fix.
  • Maintenance.

Contribution

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>
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.

1 participant