Skip to content

[ISSUE #10748] Fix unsupported ProxyChannel command completion - #10752

Open
ai-yang wants to merge 1 commit into
apache:developfrom
ai-yang:agent/fix-proxychannel-unsupported-command
Open

[ISSUE #10748] Fix unsupported ProxyChannel command completion#10752
ai-yang wants to merge 1 commit into
apache:developfrom
ai-yang:agent/fix-proxychannel-unsupported-command

Conversation

@ai-yang

@ai-yang ai-yang commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

ProxyChannel.writeAndFlush() created an incomplete processFuture before dispatching a RemotingCommand, but the default switch 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:

  • completes the existing processing future exceptionally for unsupported remoting command codes;
  • includes the unsupported request code in the failure for diagnosis;
  • keeps relay services untouched for commands that have no supported dispatch path;
  • reports that the command was not delivered instead of returning success or waiting for a response that cannot arrive.

How Did You Test This Change?

  • Unmodified develop: the deterministic strengthened regression failed in 5/5 isolated JDK 8 Maven processes.
  • Fixed regression: 20 isolated Maven/JVM processes at 1/1 each (20/20 total).
  • Complete proxy -am reactor: all 11 modules passed with 0 failures and 0 errors.
  • Project Checkstyle: 0 violations.
  • SpotBugs: 0 bug instances and 0 errors.
  • Maven validate: passed.
  • git diff --check: passed.

Compatibility and Failure Semantics

Supported RemotingCommand branches and non-RemotingCommand messages are unchanged. Only the unsupported request-code branch changes: instead of leaving the returned ChannelFuture pending forever, it now completes exceptionally and does not invoke a relay service, allowing callers to observe that the command was not delivered.

@ai-yang
ai-yang marked this pull request as ready for review August 2, 2026 14:21

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — Adding processFuture.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 is UnsupportedOperationException, 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 RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Defensive fix with proper validation and test coverage. LGTM.


Automated review by github-manager-bot

@ai-yang

ai-yang commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

@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.

@ai-yang
ai-yang force-pushed the agent/fix-proxychannel-unsupported-command branch from 1916011 to 84147bc Compare August 27, 2026 15:36
@ai-yang

ai-yang commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Refreshed this PR against the latest develop (e348efa66b08eb645ee123706ea6492fa9a3ad35, RocketMQ 5.5.1).

  • refreshed head: 84147bcdc (one signed-off commit);
  • complete ProxyChannelTest: 2/2 passed;
  • all 11 modules in the targeted proxy -am reactor completed successfully, including Checkstyle and SpotBugs;
  • git diff --check passed.

The force-push has retriggered the full CI matrix.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.48%. Comparing base (e348efa) to head (84147bc).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ProxyChannel leaves unsupported RemotingCommand writes permanently pending

3 participants