RockteMQ-AI commented on issue #10931: URL: https://github.com/apache/rocketmq/issues/10931#issuecomment-5301289145
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The reported issue has been verified against the current codebase (`develop` branch). **Root Cause:** `ClusterTransactionService.brokerAddrNameMapRef` is initialized as `new AtomicReference<>()` (i.e. the inner map is `null`). `getBrokerNameByAddr()` calls `brokerAddrNameMapRef.get().get(brokerAddr)` without a null-check, so any transaction send that arrives before the first heartbeat scan completes will throw `NullPointerException`. **Call path:** `AbstractTransactionService.addTransactionDataByBrokerAddr()` → `this.getBrokerNameByAddr(brokerAddr)` → NPE. Note that `addTransactionDataByBrokerName()` already handles a blank broker name gracefully (returns `null`), so the fix only needs to make `getBrokerNameByAddr()` null-safe. **Impact:** Proxy cluster transaction service — any transactional message sent during proxy startup or before route discovery completes will fail. **Severity:** Medium — affects the startup window only; self-heals once the first heartbeat scan populates the map. **Proposed fix:** Initialize `brokerAddrNameMapRef` with `Collections.emptyMap()` (or add a null-guard in `getBrokerNameByAddr`) and add a regression test that calls `addTransactionDataByBrokerAddr` before the first heartbeat scan. An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation. --- *Automated evaluation by github-manager* -- 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]
