Skip to content

Close channel on RPC timeout - #2128

Merged
michaelklishin merged 2 commits into
mainfrom
rpc-timeout-closes-channel
Oct 15, 2026
Merged

michaelklishin merged 2 commits into
mainfrom
rpc-timeout-closes-channel

Conversation

@acogoluegnes

Copy link
Copy Markdown
Contributor

AMQP 0-9-1 replies cannot be correlated with their requests. When a
channel RPC timed out, the channel stayed open and the late reply of
the timed out request could be handed to a subsequent RPC on the same
channel (e.g. a basic.get-ok for a queue returned to a basic.get on
another queue).

The channel is now closed when one of its RPC calls times out. The
channel.close is sent without waiting for the close-ok: inbound
commands, including the late reply, are discarded until the close-ok
arrives, then the channel number is released and shutdown listeners
are notified. The close reason has the TimeoutException as its cause.

Applications must create a new channel after a
ChannelContinuationTimeoutException.

AMQP 0-9-1 replies cannot be correlated with their requests. When a
channel RPC timed out, the channel stayed open and the late reply of
the timed out request could be handed to a subsequent RPC on the same
channel (e.g. a basic.get-ok for a queue returned to a basic.get on
another queue).

The channel is now closed when one of its RPC calls times out. The
channel.close is sent without waiting for the close-ok: inbound
commands, including the late reply, are discarded until the close-ok
arrives, then the channel number is released and shutdown listeners
are notified. The close reason has the TimeoutException as its cause.

Applications must create a new channel after a
ChannelContinuationTimeoutException.
@acogoluegnes
acogoluegnes marked this pull request as ready for review October 15, 2026 16:35
@michaelklishin
michaelklishin merged commit 8e6746e into main Oct 15, 2026
7 of 9 checks passed
@michaelklishin
michaelklishin deleted the rpc-timeout-closes-channel branch October 15, 2026 23:39
@michaelklishin michaelklishin added this to the 6.0.0 milestone Oct 15, 2026
@acogoluegnes

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport v5.x

@mergify

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

backport v5.x

✅ Backports have been created

Details

Cherry-pick of 6af538a has failed:

On branch mergify/bp/v5.x/pr-2128
Your branch is up to date with 'origin/v5.x'.

You are currently cherry-picking commit 6af538a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   src/main/java/com/rabbitmq/client/ChannelContinuationTimeoutException.java
	modified:   src/main/java/com/rabbitmq/client/ConnectionFactory.java
	modified:   src/main/java/com/rabbitmq/client/impl/ChannelN.java
	modified:   src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/main/java/com/rabbitmq/client/impl/AMQChannel.java

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

michaelklishin added a commit that referenced this pull request Oct 16, 2026
Close channel on RPC timeout (backport #2128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants