Skip to content

fix(pidbox): default to exclusive queues for RabbitMQ 4.3.0 compatibility#2530

Closed
Nusnus wants to merge 1 commit into
celery:mainfrom
Nusnus:rabbitmq-430-fix
Closed

fix(pidbox): default to exclusive queues for RabbitMQ 4.3.0 compatibility#2530
Nusnus wants to merge 1 commit into
celery:mainfrom
Nusnus:rabbitmq-430-fix

Conversation

@Nusnus
Copy link
Copy Markdown
Member

@Nusnus Nusnus commented Apr 27, 2026

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.49%. Comparing base (339fb58) to head (16caf5e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2530   +/-   ##
=======================================
  Coverage   82.49%   82.49%           
=======================================
  Files          79       79           
  Lines       10190    10190           
  Branches     1170     1170           
=======================================
  Hits         8406     8406           
  Misses       1582     1582           
  Partials      202      202           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@auvipy auvipy requested review from auvipy and Copilot April 27, 2026 17:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Kombu’s pidbox mailbox queue defaults to improve compatibility with RabbitMQ 4.3.0 behavior around transient, non-exclusive queues.

Changes:

  • Change Mailbox default queue_exclusive from False to True.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kombu/pidbox.py
Comment on lines 183 to 185
queue_ttl=None, queue_expires=None,
queue_durable=False, queue_exclusive=False,
queue_durable=False, queue_exclusive=True,
reply_queue_ttl=None, reply_queue_expires=10.0):
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the default queue_exclusive to True makes Mailbox(..., queue_durable=True) raise ValueError unless callers also pass queue_exclusive=False, which is a backwards-incompatible behavior change. Consider using a sentinel/None default for queue_exclusive and deriving the effective value from queue_durable (e.g., default to exclusive only when queue_durable is false), so existing durable-queue callers don’t break while still fixing the transient non-exclusive RabbitMQ case.

Copilot uses AI. Check for mistakes.
Comment thread kombu/pidbox.py
Comment on lines +184 to 185
queue_durable=False, queue_exclusive=True,
reply_queue_ttl=None, reply_queue_expires=10.0):
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With queue_exclusive=True by default, starting a second node with the same hostname will likely fail during queue_declare (exclusive queue in use) before Queue.on_declared runs, so W_PIDBOX_IN_USE won’t be surfaced anymore. Consider catching the exclusive-queue declare failure and re-raising an InconsistencyError (or emitting the existing warning) with the actionable W_PIDBOX_IN_USE guidance, so users get a consistent, helpful message.

Copilot uses AI. Check for mistakes.
Comment thread kombu/pidbox.py
Comment on lines +184 to 185
queue_durable=False, queue_exclusive=True,
reply_queue_ttl=None, reply_queue_expires=10.0):
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the default queue flags (and may change runtime behavior/validation), but there’s no unit test asserting the new default behavior (e.g., that Mailbox('x') now creates exclusive, auto-delete pidbox + reply queues, and that Mailbox(..., queue_durable=True) still behaves as intended). Adding a focused test will prevent regressions across transports and clarify the intended defaults.

Copilot uses AI. Check for mistakes.
@Nusnus
Copy link
Copy Markdown
Member Author

Nusnus commented Apr 27, 2026

Attempted fix instead: #2531

@Nusnus Nusnus closed this Apr 27, 2026
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.

2 participants