Skip to content

Add a client-side time budget to RabbitmqBroker.enqueue - #881

Open
davidt99 wants to merge 1 commit into
Bogdanp:masterfrom
intezer:rabbitmq-enqueue-time-budget
Open

Add a client-side time budget to RabbitmqBroker.enqueue#881
davidt99 wants to merge 1 commit into
Bogdanp:masterfrom
intezer:rabbitmq-enqueue-time-budget

Conversation

@davidt99

Copy link
Copy Markdown
Contributor

In a clustered broker, an ungraceful node loss (frozen VM, partition) blocks a confirmed publish for ~net_ticktime (60s) instead of failing fast, and enqueue retries that up to MAX_ENQUEUE_ATTEMPTS times -- a single send can stall for minutes.

  • dramatiq_max_enqueue_duration: optional per-enqueue wall-clock budget (ms, 0/default off). Checked between attempts, so it caps the retry loop at ~budget + one attempt.
  • Make MAX_ENQUEUE_ATTEMPTS / MAX_DECLARE_ATTEMPTS env-configurable.

Although it's more relevant to quorum queues, I've validated it affects also classic queues in a cluster mode.

In a clustered broker, an ungraceful node loss (frozen VM, partition) blocks a
confirmed publish for ~net_ticktime (60s) instead of failing fast, and enqueue
retries that up to MAX_ENQUEUE_ATTEMPTS times -- a single send can stall for
minutes.

- dramatiq_max_enqueue_duration: optional per-enqueue wall-clock budget (ms,
  0/default off). Checked between attempts, so it caps the retry loop at
  ~budget + one attempt.
- Make MAX_ENQUEUE_ATTEMPTS / MAX_DECLARE_ATTEMPTS env-configurable.
- Log exc_info on the retry paths; document the env vars; add a test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@davidt99
davidt99 force-pushed the rabbitmq-enqueue-time-budget branch from c533f38 to abe0b0c Compare July 23, 2026 10:54
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.

1 participant