Repository navigation
[fix] Resume consumer after netty channel writable change - #1944
Merged
Merged
Conversation
|
@gaoran10:Thanks for your contribution. For this PR, do we need to update docs? |
|
@gaoran10:Thanks for providing doc info! |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the changes intended to resume stalled AMQP consumer delivery when connections become writable.
No open issues 🎉
What changed in this PR
This PR addresses stalled shared consumers by notifying their subscriptions when an AMQP connection becomes writable again.
Changes:
- Schedule dispatch wakeups asynchronously, rechecking connection activity and writability without adding consumer credit.
- Add a regression test that forces unwritability and verifies queued messages resume delivery exactly once.
- Remove the decoder’s logging-only writability handler, explicit decoder getter, and related documentation workaround.
| File | Description |
|---|---|
tests/src/test/java/io/streamnative/pulsar/handlers/amqp/rabbitmq/RabbitMQMessagingTest.java |
Tests delivery resumption after connection writability is restored. |
amqp-impl/src/test/java/io/streamnative/pulsar/handlers/amqp/test/AmqpProtocolTestBase.java |
Removes the decoder-access workaround from a comment. |
amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpConnection.java |
Adds deferred subscription notifications when the connection becomes writable. |
amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpCommandDecoder.java |
Removes the logging-only writability override and explicit decoder getter. |
Review effort: Balanced
Technoboy-
approved these changes
Oct 29, 2026
gaoran10
added a commit
that referenced
this pull request
Oct 29, 2026
(cherry picked from commit e72d982)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Shared consumers can stall after the AMQP connection becomes unwritable. Pulsar’s updated dispatcher waits for a writability notification to resume reads, but AoP’s connection handler did not forward that notification to its consumers.
Modifications
Resume dispatch when the AMQP connection becomes writable again, without adding consumer credit. Schedule the wakeup asynchronously and recheck that the connection is active and writable before notifying subscriptions.
Add a regression test that forces the connection unwritable, waits for dispatch to stop, then restores writability and verifies that queued messages are delivered.
Documentation
Check the box below.
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)