You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "cshannon (via GitHub)" <gi...@apache.org> on 2026/07/09 15:02:43 UTC

[PR] Add tests validating TextMessage body thread safety fix [activemq]

cshannon opened a new pull request, #2207:
URL: https://github.com/apache/activemq/pull/2207

   @mattrpav authored this and I forgot to merge into #2188 so I'm pushing up a new PR with the commit
   
   Validates the fix for the race between getText(), storeContentAndClear() and copy() on a shared ActiveMQTextMessage instance that could null the message body: getText() decoded content into text and cleared content while storeContentAndClear() observed the pre-clear content, skipped re-encoding, and cleared text — losing the body permanently. Triggered on the broker by XPath selector evaluation or JMX browse racing dispatch marshalling, with the network bridge copy() adding a third participant.
   
   Four tests:
   - sequential control: getText/storeContentAndClear round trips preserve the body
   - two-way race: 20k iterations of concurrent getText vs storeContentAndClear; no iteration may lose the body
   - three-way race including copy(): both the original and the copy must retain a recoverable body (pre-fix this loses the original's body within a few thousand iterations)
   - deterministic lock-discipline pin: the fix serializes the text/content state transitions on the message instance, so storeContentAndClear() must block while another thread holds the message monitor; fails immediately on any regression to unsynchronized transitions
   
   Verified failing (2 of 4) against the pre-fix base and passing after #2188 


-- 
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: gitbox-unsubscribe@activemq.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] Add tests validating TextMessage body thread safety fix [activemq]

Posted by "cshannon (via GitHub)" <gi...@apache.org>.
cshannon merged PR #2207:
URL: https://github.com/apache/activemq/pull/2207


-- 
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: gitbox-unsubscribe@activemq.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact