pradeep85841 commented on PR #1659:
URL: https://github.com/apache/activemq/pull/1659#issuecomment-3918308200

   To clarify the background task involvement: in a standard serial flow, the 
Destination handles the guards correctly. However, in my 
ActiveMQTextMessageStressTest, the race occurs during high-concurrency 
scenarios where multiple threads interact with the message command.
   
   The failure specifically occurs here: Caused by: java.lang.AssertionError: 
Text should never be null during stress at line 138
   
   This trace confirms that even though the message was produced with text, the 
unmarshalled state was cleared out from under the consumer thread before it 
could be read.
   
   Because clearUnmarshalledState() is public, it can be invoked by internal 
broker components (like Advisory dispatchers or NIO transport threads) to 
reduce memory footprint. Since the current implementation doesn't check if 
content is actually populated before nulling the text, it creates this 
'double-null' state.
   
   Hardening the command itself makes it 'safe by default,' protecting data 
integrity regardless of which internal broker component calls the cleanup


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to