fix: make Celery broker self-heal after Redis switch-over - #210
Open
torkashvand wants to merge 1 commit into
Open
fix: make Celery broker self-heal after Redis switch-over#210torkashvand wants to merge 1 commit into
torkashvand wants to merge 1 commit into
Conversation
torkashvand
force-pushed
the
fix/celery-broker-self-healing-redis-switchover
branch
2 times, most recently
from
August 5, 2026 17:31
63df985 to
81ee14d
Compare
The LSO Celery worker pins to a single Redis broker URL (a virtual IP in GAP) and only set broker_connection_retry_on_startup, so when that IP moves between Redis nodes the broker connection resets and the worker can get stuck until a manual restart. Add broker connection retry, an unbounded reconnect limit (None, since Kombu treats 0 as fail-fast), TCP keep-alive, periodic health checks and retry-on-timeout on the Redis broker and RedBeat connections so the worker reconnects automatically. The result store is rpc://, not Redis, so it needs none of these. Values are overridable via CELERY_* env vars.
torkashvand
force-pushed
the
fix/celery-broker-self-healing-redis-switchover
branch
from
August 5, 2026 18:49
81ee14d to
88b5bc4
Compare
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.
Make the LSO Celery worker recover automatically after a Redis broker switch-over instead of staying stuck until a manual restart. Previously only
broker_connection_retry_on_startupwas set, so a connection lost at runtime was never redialed.A switch-over breaks connections in two ways, both covered here:
ReadOnlyError):broker_channel_error_retrymakes the worker treat this as recoverable and redial (see Regard backend redis's switching to replica as recoverable error celery/celery#7946).The result store gets the same hardening through the top-level
redis_*settings. All values are overridable viaCELERY_*env vars; tests added. Nothing here ties LSO to Redis — other brokers simply ignore the redis-specific options.