[
https://issues.jboss.org/browse/JGRP-1718?page=com.atlassian.jira.plugin....
]
Bela Ban edited comment on JGRP-1718 at 10/18/13 10:26 AM:
-----------------------------------------------------------
Hi Rich,
good investigation !
Byte buffers in a {{Message}} are never copied as they are considered *immutable*, see the
javadoc in [1] for example. Actually, they are copied in some cases, but we try to
minimize the amount of copying done.
{{Message.copy()}} is one case where multiple threads might access the same message at the
same time, retransmission is another one: if the bit in the message was flipped and the
same message happened to get retransmitted at the same time, the flipped bit would be
sent, wreaking havoc at the receiver(s).
[1]
https://github.com/belaban/JGroups/blob/master/src/org/jgroups/Message.ja...
was (Author: belaban):
Hi Rich,
good investigation !
Byte buffers in a {{Message}} are never copied as they are considered *immutable*, see the
javadoc in [1] for example. Actually, they are copied in some cases, but we try to
minimize the amount of copying done.
{{Message.copy()}} is one case where multiple thread might access the same message at the
same time, retransmission is another one: if the bit in the message was flipped and the
same message happened to get retransmitted at the same time, the flipped bit would be
sent, wreaking havoc at the receiver(s).
[1]
https://github.com/belaban/JGroups/blob/master/src/org/jgroups/Message.ja...
Message corruption under heavy load
-----------------------------------
Key: JGRP-1718
URL:
https://issues.jboss.org/browse/JGRP-1718
Project: JGroups
Issue Type: Bug
Affects Versions: 3.2.12
Environment: JBoss AS 7.2.0.Final (includes JGroups 3.2.7.Final, upgrading to
3.2.12.Final had no effect)
Reporter: Rich DiCroce
Assignee: Bela Ban
In my project, I'm using the Kryo serialization library to serialize/deserialize
objects to/from byte[]. Some of these byte arrays appear to be getting corrupted during
transmission.
The problem happens very infrequently and only under load. I have to send tens of
thousands of messages from hundreds of threads just to get two or three errors. The
exception occurs when Kryo tries to deserialize the byte[] on the receiving node. So far,
all of the errors I've seen happen when Kryo tries to find a class to deserialize an
object, and the stack traces end with something like:
Caused by: java.lang.ClassNotFoundException: java.util.Date[SOH][GS]
Note that the [SOH] and [GS] are not literally those strings, they're unprintable
ASCII 0x1 and 0x1D.
I'm confident that Kryo itself is not the source of the problem. I added some code to
my project to deserialize the message on the sending node, immediately after serializing
it, and log any exception thrown from the deserialization. The sending node did not log an
exception, but the receiving node still did. My code passes the byte[] to the Message
constructor without doing anything to it.
It also appears that I am not the first person to encounter this issue. See
https://code.google.com/p/kryo/issues/detail?id=102
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira