QQ churn and identity change: re-declaring a quorum queue with the same name and a concurrent active publisher leads said publisher to be stuck in flow control

Author: inoa-jboliveiraCreated Sep 28, 2026Updated Sep 30, 2026

Maintainer Edits

Important: portion of this description turned out to be incorrect or incomplete, so the repro.py part is what anyone looking into an alternative fix should rely on, keeping in mind that

  1. The quorum queue identity changes (it is deleted and re-declared under the same name) during the run
  2. There are known scenarios where quorum queues are known to NOT handle such identity changes gracefully, and some require fundamental internal changes like the introduction of UUIDs for Raft member identities were (but that doesn't cover every scenario)

The Original Description

  1. All versions tested (3.13.7 → 4.3.6): that publisher's messages never reach the re-declared queue.
  2. 4.1.5 and later: the rejected pre-settled messages also stay in the client's pending map forever. It passes SOFT_LIMIT, the session goes slow, and the connection enters flow and is never read again. Every message on that connection is lost, to any queue. The client gets no connection.blocked, no channel close, no error.

4.1.4 is not affected by (2), 4.1.5 is. The change is in rabbit_fifo_client:seq_applied/2 from #14589, which keeps not_enqueued pre-settled commands pending for a later resend. After a forced delete that resend can never succeed.

As far as we can tell the root cause is that the forced path (force_delete_queue/1 in rabbit_quorum_queue) never runs rabbit_fifo:state_enter(eol, ...), so enqueuers are never told the queue is gone.

Reproduction steps

Run repro.py (attached repro.py) needs Docker and uv. It starts a throw-away broker, publishes pre-settled messages on one connection to two quorum queues H and Q, and then deletes Q. To force the timeout fallback it suspends Q's Ra server first. It then re-declares Q and keeps publishing, counting what arrives on H.

uv run --with pika==1.3.2 python repro.py --image rabbitmq:4.1.4   # no stall
uv run --with pika==1.3.2 python repro.py --image rabbitmq:4.1.5   # STALL
uv run --with pika==1.3.2 python repro.py --image rabbitmq:4.3     # STALL
uv run --with pika==1.3.2 python repro.py --mode clean             # normal delete: no stall

Output on 4.3.6:

broker logged "Attempting force delete": True
  + 10s  P sent to H:   198  H received:   127  | Q session: pending=154 slow=true next_enqueue_seq=296
  + 30s  P sent to H:   644  H received:   127  | Q session: pending=154 slow=true next_enqueue_seq=296
connection states on the broker: ['flow', 'running']
connection.blocked sent to P: False
messages from P that landed in the re-declared Q (sent 644): 0

Expected behavior

After a queue is deleted, forced or not, existing channels should drop their session for it, or be told to reset their sequence. Messages to the re-declared queue should be enqueued. A resend that can never succeed should never be able to block the whole connection.

Additional context

We hit this in production on a single-node 4.2 broker. Quorum queues with x-expires expire while their application restarts. Some of those deletes log [{timeout,...}], [{error,shutdown}] or [{error,noproc}] and are force-deleted. Long-lived processes that were publishing to those queues then go silent ~30 min later until they are restarted.

It would be very nice if the fix is backported to 4.2 (if possible).

Source: rabbitmq/rabbitmq-server