[jboss-cvs] JBoss Messaging SVN: r8008 - branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 13 08:35:11 EDT 2010
Author: gaohoward
Date: 2010-04-13 08:35:10 -0400 (Tue, 13 Apr 2010)
New Revision: 8008
Modified:
branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java
Log:
https://jira.jboss.org/jira/browse/JBMESSAGING-1799
Modified: branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java 2010-04-13 06:35:51 UTC (rev 8007)
+++ branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java 2010-04-13 12:35:10 UTC (rev 8008)
@@ -148,14 +148,15 @@
throw new IllegalStateException("Flush is not supported on the UDP Channel, please check your JGroups UDP stack as Flush is required");
}
+ View view = controlChannel.getView();
+ boolean first = (view != null && view.size() == 1 && view.getMembers().get(0).equals(controlChannel.getLocalAddress()));
+
//The first thing that happens after connect is a view change arrives
//Then the state will arrive (if we are not the first member)
//Then the control messages will start arriving.
//We can guarantee that messages won't arrive until after the state is set because we use
//the FLUSH protocol on the control channel
-
- boolean first = !(controlChannel.getState(null, stateTimeout));
-
+
if (first)
{
//First member of the group
@@ -163,15 +164,7 @@
//Can now start accepting messages
ready.set(true);
-
- if (latch == null)
- {
- throw new IllegalStateException("Check your JGroups stack... You probably don't have pbs.flush in your stack what might cause problems on JBoss Messaging");
- }
- else
- {
- latch.countDown();
- }
+ latch.countDown();
starting = false;
@@ -179,7 +172,8 @@
}
else
{
- //We are not the first member of the group, so let's wait for state to be got and processed
+ //We are not the first member of the group, so let's get state and wait for state to be processed
+ controlChannel.getState(null, stateTimeout);
waitForState();
More information about the jboss-cvs-commits
mailing list