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

   ## Problem
   
   `ClusterTransactionService` initializes `brokerAddrNameMapRef` without a 
map. Before the first successful transaction-heartbeat scan, 
`getBrokerNameByAddr` dereferences `brokerAddrNameMapRef.get()` directly.
   
   `AbstractTransactionService.addTransactionDataByBrokerAddr` calls this 
method on the transaction send path, so an otherwise valid transaction can fail 
with `NullPointerException` during proxy startup or before route discovery has 
completed.
   
   ## Expected behavior
   
   An unresolved broker address should follow the existing 
`AbstractTransactionService.addTransactionDataByBrokerName` behavior: return 
`null` and do not record transaction data.
   
   ## Proposed fix
   
   Initialize the address-to-broker-name mapping with an empty map (or 
null-check it) and add a regression test covering 
`addTransactionDataByBrokerAddr` before the first heartbeat scan.
   
   ## Scope
   
   Proxy cluster transaction service. This does not change transaction protocol 
behavior after route discovery.


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