RockteMQ-AI commented on issue #10853: URL: https://github.com/apache/rocketmq/issues/10853#issuecomment-5225264385
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The issue is valid. `HAConnectionState.values()` is indexed directly by ordinal from the peer without bounds checking. An unknown ordinal throws `ArrayIndexOutOfBoundsException` in the read path. The HA client has the same unsafe lookup. **Root Cause:** Direct array indexing by ordinal without bounds checking in auto-switch HA read path. **Impact:** HA module — a malformed or newer peer can crash the broker. **Severity:** medium **Recommended fix:** Use a bounds-checked lookup (static map or method) to decode ordinals safely. Reject unknown states with a log warning instead of throwing. An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation. --- *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]
