Learn Labs
Operations

Failure Scenarios

How RabbitMQ systems break in production, and how each looks

Most of these were reproduced while building this module, and are marked.

#FailureSymptomWhere to lookFix
1Queues created with one member (reproduced)type quorum but members [one node]; a single node loss loses themlist_queues name type memberstarget_cluster_size_hint, membership reconciliation, rabbitmq-queues grow
2Node down (reproduced)Leaders move; clients reconnectcluster_status; dashboardRestart; quorum queues keep working with a majority
3Client can't fail over (reproduced)Crash with a DNS error when a node goes awayClient logs (gaierror)Try each node; catch network errors, not just AMQP ones
4Resource alarm (reproduced)Every publisher hangs; consumers finerabbitmq-diagnostics alarmsDrain the backlog, add consumers, add memory/disk; connection.blocked handlers
5Silent loss: unroutable (reproduced)Published messages never arriveUnroutable metricsmandatory, alternate exchanges, correct bindings
6Silent loss: overflow without confirms (reproduced)Queue at its limit drops new messages; publisher sees nothingQueue length, confirm nacksPublisher confirms; handle nacks
7Poison message loop (reproduced)100% CPU consumer, constant redeliveries, queue stuckRedelivered rateReject without requeue; delayed retries with an attempt count
8Crash-looping consumer (reproduced)Message bounces until the delivery limitx-delivery-count, dead-letter rateFix the bug; inspect the dead-letter queue
9Prefetch too high (reproduced)Slow consumers hoard work, others idleUnacked per consumerPrefetch sized to processing time
10Connection churnBroker CPU high, connections_opened rate highDashboard churn panelOne long-lived connection per process
11Long queueLatency high, memory/disk growing, Raft log largeReady count over timeScale consumers on depth; length limits; streams for big backlogs
12Consumer timeoutLong jobs killed and redelivered every 30 minChannel closed with PRECONDITION_FAILED (delivery ack timeout)Raise consumer_timeout for that queue, or break up the job
13Quorum lostTwo of three nodes down: the queue stops accepting writesquorum_statusRestore a majority; never run two-node clusters
14Drain didn't move everything (reproduced)Stream still led by a node in maintenancelist_queues name type leaderVerify after draining

Reading the signals

"Publishers are hanging." Almost always a resource alarm: check rabbitmq-diagnostics alarms first. Then flow control (connections in state flow in the UI), then a queue at reject-publish overflow (with confirms, the publisher sees nacks), then quorum loss.

"Messages are missing." Unroutable (check the metric and bindings)? Overflow with drop-head, or reject-publish without confirms? Expired by TTL (dead-letter reason expired, or just gone if there's no DLX)? Auto-ack consumer that crashed? A non-durable queue or transient message on a classic queue across a restart?

"Messages are processed twice." Expected under at-least-once: consumer crashed after the side effect and before the ack, or a publisher retried after a lost confirm. Make the consumer idempotent.

Game day

docker compose -f compose_prod.yaml run --rm labs python quorum_failover.py   # keep running
docker stop rabbit-2                                     # 1. node down
docker stop rabbit-3                                     # 2. quorum lost: what happens to publishing?
docker start rabbit-2 rabbit-3
docker exec rabbit-1 rabbitmqctl set_vm_memory_high_watermark 0.0001   # 3. memory alarm
docker exec rabbit-1 rabbitmqctl set_vm_memory_high_watermark 0.6
# 4. poison message: publish invalid JSON to a queue whose consumer nack-requeues on parse errors
# 5. unroutable: publish to orders with routing key "orderz.created.eu" in a loop

For each, note what alerted first and what a human had to do.

On this page