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

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.

@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

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

2 participants