[ISSUE #10748] Fix unsupported ProxyChannel command completion - #10752
[ISSUE #10748] Fix unsupported ProxyChannel command completion#10752ai-yang wants to merge 1 commit into
Conversation
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Fixes a resource leak where unsupported remoting commands in ProxyChannel.writeAndFlush would leave the processFuture hanging indefinitely by completing it with UnsupportedOperationException in the default switch case.
Findings
- [Info]
ProxyChannel.java:114— AddingprocessFuture.completeExceptionally()in the default case is the correct fix. Previously, callers waiting on the future for an unsupported command code would block forever, potentially leaking threads and memory. - [Info] The exception message includes the unsupported command code, which aids debugging.
- [Info]
ProxyChannelTest.java— Test verifies that the future completes with failure, the cause isUnsupportedOperationException, and the message contains the command code. Also verifies no interaction with the relay service for unsupported commands.
Suggestions
- None. Simple, correct fix with good test coverage.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Defensive fix with proper validation and test coverage. LGTM.
Automated review by github-manager-bot
|
@lizhimins @lollipopjin, could you please take a human review when convenient? This is a focused ProxyChannel completion fix: unsupported remoting command codes now fail the returned future instead of leaving it pending, while supported branches remain unchanged. The complete 11-module reactor, Checkstyle, and SpotBugs pass. The remaining GitHub Actions runs are currently awaiting maintainer approval. |
Signed-off-by: Rui <1685901819@qq.com>
1916011 to
84147bc
Compare
|
Refreshed this PR against the latest
The force-push has retriggered the full CI matrix. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #10752 +/- ##
=============================================
- Coverage 48.58% 48.48% -0.10%
+ Complexity 13676 13647 -29
=============================================
Files 1381 1381
Lines 101475 101477 +2
Branches 13190 13190
=============================================
- Hits 49299 49203 -96
- Misses 46174 46253 +79
- Partials 6002 6021 +19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Which Issue(s) This PR Fixes
Brief Description
ProxyChannel.writeAndFlush()created an incompleteprocessFuturebefore dispatching aRemotingCommand, but thedefaultswitch branch only broke out of the switch. No producer remained that could complete the future, so the returned channel future stayed pending forever.This change:
How Did You Test This Change?
develop: the deterministic strengthened regression failed in 5/5 isolated JDK 8 Maven processes.proxy -amreactor: all 11 modules passed with 0 failures and 0 errors.git diff --check: passed.Compatibility and Failure Semantics
Supported
RemotingCommandbranches and non-RemotingCommandmessages are unchanged. Only the unsupported request-code branch changes: instead of leaving the returnedChannelFuturepending forever, it now completes exceptionally and does not invoke a relay service, allowing callers to observe that the command was not delivered.