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

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   The potential NPE in `DefaultHAConnection` and `AutoSwitchHAConnection` is 
valid. `getRemoteSocketAddress()` can return `null` if the socket is not 
connected (e.g., peer disconnects immediately after accept). Calling 
`.toString()` on null will throw NPE.
   
   **Root Cause:** Missing null check before `.toString()` on 
`getRemoteSocketAddress()`.
   **Impact:** NPE crashes HA connection setup during network instability.
   **Severity:** Medium (edge case during network issues, but can disrupt HA 
replication)
   
   Suggested fix: Add null check and handle gracefully (e.g., log warning and 
skip connection, or use a fallback address string).
   
   ---
   *Automated evaluation by RockteMQ-AI*


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