Aias00 opened a new issue, #10692:
URL: https://github.com/apache/rocketmq/issues/10692

   ### Bug description
   
   `HAProxyMessageForwarder.buildHAProxyMessage` parses source and destination 
ports with `Integer.parseInt` from either proxy protocol channel attributes or 
the channel remote/local address strings.
   
   If a port value is malformed, for example a non-numeric proxy protocol port 
attribute or a malformed channel address, `buildHAProxyMessage` can throw 
`NumberFormatException`. This makes HAProxy message forwarding fail with a 
runtime parsing exception instead of simply skipping an invalid proxy protocol 
message.
   
   ### Expected behavior
   
   Invalid or malformed proxy protocol port values should not throw from 
HAProxy message construction. The forwarder should treat the HAProxy message as 
unavailable and return `null`, consistent with existing behavior when required 
attributes are missing.
   
   ### Affected area
   
   `proxy` module, remoting HTTP/2 proxy HAProxy protocol forwarding.
   
   ### Suggested fix
   
   - Parse proxy protocol ports through a safe helper.
   - Return `null` when source or destination ports cannot be parsed.
   - Keep existing behavior for valid port values.
   - Add unit tests for valid channel address parsing and malformed port values.
   


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