Skip to content

Comments

Fix PauseThenRequeue not pausing listener. Closes GH-2078#2150

Merged
jeremydmiller merged 1 commit intomainfrom
pause-then-requeue
Feb 9, 2026
Merged

Fix PauseThenRequeue not pausing listener. Closes GH-2078#2150
jeremydmiller merged 1 commit intomainfrom
pause-then-requeue

Conversation

@jeremydmiller
Copy link
Member

Summary

  • RabbitMqEnvelope.DeferAsync() never ACKed the original delivery, permanently consuming a prefetch slot. With PreFetchCount(1), the requeued copy could never be delivered. Now ACKs the original before re-publishing a new copy.
  • RequeueContinuation used Task.Delay() instead of actually pausing the listener, so the requeued message was picked up immediately in a tight loop. Now pauses the listener via IListenerCircuit.PauseAsync() on a background task (to avoid deadlocking BufferedReceiver.DrainAsync()).
  • Added reproduction test with PreFetchCount(1) that verifies the message is reprocessed after the configured pause.

Test plan

  • New Bug_2078_pause_then_requeue test passes (2 attempts, ~3s gap)
  • Existing requeue tests in CoreTests pass (7/7)
  • RabbitMQ durable compliance tests pass (18/18)
  • RabbitMQ dead letter queue tests pass

🤖 Generated with Claude Code

GH-2078

Two bugs: RabbitMqEnvelope.DeferAsync() never ACKed the original delivery
(consuming a prefetch slot permanently), and RequeueContinuation used
Task.Delay instead of actually pausing the listener. Now ACKs the original
before re-publishing, and pauses the listener on a background task to avoid
deadlocking BufferedReceiver.DrainAsync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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