[ 
https://issues.apache.org/jira/browse/AMQ-6142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15228163#comment-15228163
 ] 

Christopher L. Shannon commented on AMQ-6142:
---------------------------------------------

[~gtully], This diff makes sense to fix the copy which is the root of the 
issue.  My commit had a test so if this diff is applied as a new commit CI can 
check that everything is still good.

For AMQ-6218, yes the entire problem comes down to concurrentStoreAndDispatch.  
I talked to [~tabish121] about it a little and the problem shows up when using 
the VM transport because of the same message reference but two different 
threads accessing it.  There are other messages that could be fixed but the 
text message is the main issue because of the fix from AMQ-5857 where we clear 
out the text after converting to bytes so that the data isn't stored twice but 
only counted once.  So you can get into this weird state where both bytes and 
text end up being null.   

Copying the message before doing the async store would fix this issue for sure 
and would allow the sync that I added to be backed out.  We could also back out 
the fix from AMQ-5857 as it was only applied to text messages (but other 
messages have the same issue i think) which would fix the issue as well.  I 
think that backing out the sync and copying the message before the async store 
makes the most sense but I didn't do that originally because I was concerned 
about the extra memory usage for large messages and for the memory usage 
counter to not take that into account.  But the copy is probably the right 
thing to do to prevent future problems with the async store case.

> ActiveMQBytesMessage decompress throws DataFormatException incorrect header 
> check
> ---------------------------------------------------------------------------------
>
>                 Key: AMQ-6142
>                 URL: https://issues.apache.org/jira/browse/AMQ-6142
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.10.2, 5.12.1, 5.11.3, 5.13.0
>            Reporter: Claudio Tagliola
>            Assignee: Christopher L. Shannon
>             Fix For: 5.13.1, 5.14.0
>
>         Attachments: Client.java, MessageListener.java, Server.java, 
> amq-6142.diff, pom.xml
>
>
> In our environment we use an embedded broker. On one topic where compression 
> is enabled, the server is also listening in on the messages. From ActiveMQ 
> 5.10.0 up to 5.13.0, we encounter DataFormatException: incorrect header check 
> exceptions on the tcp clients due to corruption of the payload. Attached are 
> a test server and client. At some point, the client will exit due to 
> mentioned exception. Increase chances by running multiple clients. This 
> scenario works with 5.8.0 and 5.9.1.
> If the server has multiple consumers on the same topic, they will encounter 
> corruption as well, but this has other side-effects.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to