You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "RongtongJin (via GitHub)" <gi...@apache.org> on 2025/10/13 09:29:36 UTC

[I] [Enhancement] Fix NPE when isAsyncSendEnable is false in transaction metrics recording [rocketmq]

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

   ### Before Creating the Enhancement Request
   
   - [x] I have confirmed that this should be classified as an enhancement rather than a bug/feature.
   
   
   ### Summary
   
   A potential NPE (Null Pointer Exception) issue exists in the transaction metrics recording logic in SendMessageProcessor.java when isAsyncSendEnable is configured to false.
   
   
   ### Motivation
   
   Problem Details:
   Location: broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java line 359
   Root Cause: In synchronous send mode (isAsyncSendEnable = false), the transaction metrics recording condition check is incomplete
   Specific Issue: When sendTransactionPrepareMessage is false, the code still attempts to access transaction-related metrics, potentially causing NPE
   Reproduction Steps:
   Configure isAsyncSendEnable = false
   Send non-transactional messages
   Observe logs for potential NPE occurrences
   Expected Behavior:
   Transaction metrics should only be recorded when processing transaction prepare messages, avoiding access to transaction-related services in non-transaction scenarios.
   Impact Scope:
   Message processing in synchronous send mode
   Accuracy of transaction metrics statistics
   System stability
   
   ### Describe the Solution You'd Like
   
   Fix NPE when isAsyncSendEnable is false in transaction metrics recording
   
   ### Describe Alternatives You've Considered
   
   No
   
   ### Additional Context
   
   No


-- 
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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Fix NPE when isAsyncSendEnable is false in transaction metrics recording [rocketmq]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed issue #9750: [Enhancement] Fix NPE when isAsyncSendEnable is false in transaction metrics recording
URL: https://github.com/apache/rocketmq/issues/9750


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org