RockteMQ-AI commented on issue #10748:
URL: https://github.com/apache/rocketmq/issues/10748#issuecomment-5156158407

   ## 🔧 Fix Proposal (Spec v1)
   
   **Root Cause:** In `ProxyChannel.writeAndFlush()`, when a `RemotingCommand` 
with an unrecognized request code arrives, the `default` branch of the switch 
statement only executes `break`, leaving `processFuture` (a 
`CompletableFuture`) permanently incomplete. This causes the returned 
`ChannelFuture` to hang indefinitely, eventually leading to semaphore 
exhaustion.
   
   **Proposed Fix:**
   - **`ProxyChannel.java`** (lines 113-114): Replace bare `break` with 
`processFuture.completeExceptionally(new 
UnsupportedOperationException("Unsupported request code: " + 
command.getCode()))` so the future resolves immediately with a clear error.
   - **`ProxyChannelTest.java`**: Add `testWriteAndFlushUnsupportedCode()` test 
to verify the fix.
   
   **Severity:** High — causes resource leak and hangs in production.
   
   ---
   Please review and respond with:
   - `/approve` — to proceed with creating a PR
   - `/revise <feedback>` — to request changes to the proposal
   - `/reject` — to decline this proposal
   
   _No response within 72 hours will auto-close this proposal._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to