[ISSUE #10748] Fix unsupported ProxyChannel command completion - #10752
[ISSUE #10748] Fix unsupported ProxyChannel command completion#10752ai-yang wants to merge 1 commit into
Conversation
Signed-off-by: Rui <1685901819@qq.com>
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. |
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.