Repository navigation
Conversation
e9d7c46 to
7bbc588
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10316 +/- ##
=======================================
Coverage 90.23% 90.23%
=======================================
Files 153 153
Lines 21071 21077 +6
Branches 2543 2545 +2
=======================================
+ Hits 19013 19019 +6
Misses 1751 1751
Partials 307 307
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
auvipy
left a comment
There was a problem hiding this comment.
please check the failing smoke tests
0fe18d1 to
7bbc588
Compare
|
@auvipy the issue is that the smoke tests are using the release kombu version which doesn't support prefixes. do we wait until the next kombu release? |
|
oh ok lets wait until kombu v5.7 alpha release. |
There was a problem hiding this comment.
Pull request overview
Adds a new configuration option to namespace RabbitMQ native delayed-delivery infrastructure so multiple Celery apps can share a broker without queue/exchange name collisions.
Changes:
- Add
broker_native_delayed_delivery_queue_prefixconfig (defaultNone) for namespacing delayed-delivery exchange/queues. - Forward the configured prefix from the worker delayed-delivery bootstep into kombu’s native delayed-delivery setup/bind helpers.
- Document the new option and add unit tests asserting the prefix forwarding behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| celery/app/defaults.py | Adds the new broker namespace config option with default None. |
| celery/worker/consumer/delayed_delivery.py | Reads the prefix from config and forwards it into kombu setup/bind calls. |
| docs/userguide/configuration.rst | Documents the new setting and adds it to the env-var/settings mapping table. |
| t/unit/worker/test_native_delayed_delivery.py | Updates mocks for new call signature and adds tests for prefix forwarding/defaulting. |
Suppressed comments (1)
celery/worker/consumer/delayed_delivery.py:175
- Same as above: an empty/whitespace prefix will currently be forwarded to
bind_queue_to_native_delayed_delivery_exchange, producing awkward names. Normalizing toNonekeeps behavior aligned with the docs and avoids accidental "celery_delayed*" resources.
queue_prefix = app.conf.broker_native_delayed_delivery_queue_prefix
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Description
Adds a new
broker_native_delayed_delivery_queue_prefixconfiguration option that allows namespacing the native delayed delivery exchange and queue names. This is useful when multiple Celery applications share the same RabbitMQ broker and need their delayed delivery infrastructure isolated to avoid collisions.When set, the delayed delivery exchange becomes
{prefix}_celery_delayed_deliveryand each of the 28 level queues becomes{prefix}_celery_delayed_{level}. When unset (the default), behavior is unchanged.Fixes #10310 (follow-up to #10269).
Changes
celery/app/defaults.py— newbroker_native_delayed_delivery_queue_prefixsetting (defaults toNonefor backward compatibility).celery/worker/consumer/delayed_delivery.py— reads the new setting and forwards it to both kombu setup functions.docs/userguide/configuration.rst— new setting documented withversionadded:: 5.7directive and entry in the settings table.t/unit/worker/test_native_delayed_delivery.py— adds tests verifying the prefix is forwarded to both kombu functions (and thatNoneis forwarded when unset).Backward compatibility
Fully backward compatible. The default value is
None, which means kombu uses the original (unprefixed) names. Existing deployments require no changes.