Conversation
…ixes #199 Celery's native broker URL format uses sentinel:// and kombu uses redis+sentinel:// for Redis Sentinel, while RedBeat only recognized its own redis-sentinel:// scheme in the sentinel branch of get_redis(). Accepting these as aliases lets the same DSN be reused for both broker_url and redbeat_redis_url, removing the need to rewrite the scheme by hand.
…m, document scheme aliases, add regression test - redbeat/schedulers.py: reformat the sentinel branch condition to match black's output (flake8-black failed CI as committed). - CHANGES.txt: change the entry to bugfix, and qualify what the scheme aliases actually deliver -- they only help once redbeat_redis_options (or broker_transport_options) already sets a redbeat-shaped `sentinels` list. A purely celery-native sentinel config (broker_transport_options with just master_name, hosts from a `;`-joined sentinel:// URL) still falls through to Redis.from_url and still raises. - docs/config.rst: document that sentinel:// and redis+sentinel:// are now accepted as scheme aliases, and spell out that the sentinels option is still required with them. - tests/test_scheduler.py: add a regression test pinning the remaining limitation -- a purely celery-native sentinel broker config without an explicit sentinels option still raises ValueError.
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.
What & why
get_redis()only routed to the Sentinel branch whenredbeat_redis_urlstarted with
redis-sentinel. Celery's own native sentinel scheme issentinel://and kombu's isredis+sentinel://, so a user who reuses theirbroker DSN for
redbeat_redis_urlfalls through toRedis.from_urland gets anunhelpful failure.
Fix
Match all three scheme spellings:
Scope — please read
This is deliberately only a scheme match, not full celery-native sentinel
support. The
and 'sentinels' in redis_optionscondition is unchanged, so thishelps only if
redbeat_redis_options(orbroker_transport_options) alreadysupplies an explicit
sentinelslist. A purely celery-native config —master_nameinbroker_transport_optionswith hosts derived from a;-joinedsentinel://URL — still falls through and still raises.The
CHANGES.txtentry and the newdocs/config.rstparagraph both say soexplicitly, so nobody reads this as more than it is. If you'd rather this go
the whole way and derive
sentinels/master_namefrom the URL, that's alarger change and worth its own issue.
Test plan
tests/test_scheduler.pyfor both new aliases.make testpasses (91 tests).Closes #199
Generated by Claude Code