Skip to content

Ignore already-closed channels when shutting down publisher pools - #90

Merged
jKatt merged 1 commit into
mainfrom
safe-publisher-channel-checkin
Oct 1, 2026
Merged

jKatt merged 1 commit into
mainfrom
safe-publisher-channel-checkin

Conversation

@jKatt

@jKatt jKatt commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Publish-confirm timeouts show up as Bunny::ChannelAlreadyClosed: the pool closes the already-closed channel again on checkin. That hides the timeout and makes ears retry it as a connection error, which can duplicate a message.

The pool shutdown block now skips channels that are already closed. Released as 0.26.1.

Note: a confirm timeout still resets the whole confirms pool; dropping only the failed channel is left for a follow-up.

🤖 Generated with Claude Code

A confirm timeout closes the channel and resets the confirms pool while
the channel is still checked out. On checkin the pool's shutdown block
closed it again, raising Bunny::ChannelAlreadyClosed. That masked the
PublishConfirmationTimeout, and the retry handler then retried it as a
connection error, risking a duplicate message.

Side effects:
- Confirm timeouts and nacks reach the caller and are not retried.
- A pool reset by another thread no longer makes a successful publish
  raise on checkin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jKatt
jKatt marked this pull request as ready for review October 1, 2026 06:50
@jKatt
jKatt merged commit aa0f343 into main Oct 1, 2026
7 checks passed
@jKatt
jKatt deleted the safe-publisher-channel-checkin branch October 1, 2026 07:47
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