[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. |
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 49.36% 49.29% -0.07%
+ Complexity 14230 14207 -23
=============================================
Files 1390 1390
Lines 103123 103125 +2
Branches 13484 13484
=============================================
- Hits 50904 50835 -69
- Misses 46061 46111 +50
- Partials 6158 6179 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
CI triage update: The only failing check is the Windows Maven job, where A maintainer rerun of the failed workflow would be appreciated. |
Signed-off-by: Rui <1685901819@qq.com>
84147bc to
354ba02
Compare
|
Refreshed onto Latest clean verification on JDK 8: git submodule update --init --depth 1 -- rocketmq-apis
mvn -pl proxy -am -DskipITs -Dtest=ProxyChannelTest \
-Dsurefire.failIfNoSpecifiedTests=false clean test
This starts a new full CI matrix on the current base. The previous Windows @xdkxlk @lizhimins, could you take a human review of the unsupported-code failure semantics when convenient? |
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.