[
https://issues.jboss.org/browse/JGRP-1707?page=com.atlassian.jira.plugin....
]
Bela Ban commented on JGRP-1707:
--------------------------------
The second exception:
{noformat}
version = 6400 (3.4.0)
flags: OOB
java.lang.RuntimeException: class for magic number 9625 not found
at org.jgroups.util.Util.readOtherAddress(Util.java:967)
at org.jgroups.util.Util.readAddress(Util.java:911)
at org.jgroups.util.Util.readAddresses(Util.java:1038)
at org.jgroups.View.readFrom(View.java:190)
at org.jgroups.MergeView.readFrom(MergeView.java:108)
at org.jgroups.protocols.pbcast.GMS$GmsHeader.readFrom(GMS.java:1285)
at org.jgroups.Message.readHeader(Message.java:889)
at org.jgroups.Message.readFrom(Message.java:803)
at org.jgroups.protocols.TP.readMessageBatch(TP.java:1796)
at org.jgroups.tests.ParseMessages.parse(ParseMessages.java:56)
at org.jgroups.ParserPcap.main(ParserPcap.java:37)
{noformat}
is caused by a view of a subgroup not being read correctly. The code is here:
{code}
public void readFrom(DataInput in) throws Exception {
super.readFrom(in);
short len=in.readShort();
if(len > 0) {
subgroups=new View[len];
for(int i=0; i < len; i++) {
int index=in.readShort();
long id=in.readLong();
Address creator=get(index);
Address[] mbrs=new Address[in.readShort()];
for(int j=0; j < mbrs.length; j++)
mbrs[j]=get(in.readShort());
View view=View.create(creator, id, mbrs);
subgroups[i]=view;
}
}
}
{code}
When {{View.create()}} throws an exception, and there are more views in the subgroups,
then we have unread data left, and parsing of the next header will fail.
SOLUTION: wrap {{View.create()}} in a try-catch clause and simply skip the view if an
exception is thrown
MergeView: marshalling fails when subgroups are not a subset of
members
-----------------------------------------------------------------------
Key: JGRP-1707
URL:
https://issues.jboss.org/browse/JGRP-1707
Project: JGroups
Issue Type: Bug
Reporter: Bela Ban
Assignee: Bela Ban
Fix For: 3.4
When we have 2 partitions \{A,B,C\} and \{X,Y,Z\} and they merge, but one of the members
(e.g. Z) is excluded from the merge (e.g. because it is involved in a different merge
already), we create the following MergeView:
{noformat}
MergeView:
view={A,B,C,X,Y}
subgroups={A,B,C} {X,Y,Z}
{noformat}
Because the members of the subgroups refer to the merge view via index, the index for Z
is -1, and thus - when unmarshalled - Z points to a null creator, which triggers the
following stack trace:
{noformat}
00631037-49819: failed handling incoming message
java.lang.IllegalArgumentException: creator cannot be null
at org.jgroups.ViewId.<init>(ViewId.java:32)
at org.jgroups.ViewId.<init>(ViewId.java:42)
at org.jgroups.View.create(View.java:90)
at org.jgroups.MergeView.readFrom(MergeView.java:119)
at org.jgroups.protocols.pbcast.GMS$GmsHeader.readFrom(GMS.java:1285)
at org.jgroups.Message.readHeader(Message.java:889)
at org.jgroups.Message.readFrom(Message.java:803)
at org.jgroups.protocols.TP.readMessageBatch(TP.java:1796)
at org.jgroups.protocols.TP.receive(TP.java:1463)
at org.jgroups.protocols.UDP$PacketReceiver.run(UDP.java:683)
at java.lang.Thread.run(Unknown Source)
{noformat}
SOLUTION:
* When marshalling a MergeView, and a subgroup member has no corresponding member in
{{members}}, then send the *address* instead of the index
* OR: remove all members from subgroups which are not in {{members}}
--
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