eclipse-ee4j / glassfish-shoal

Shoal
Other
5 stars 9 forks source link

Re-joining a group throws a NPE exception. #96

Closed glassfishrobot closed 13 years ago

glassfishrobot commented 14 years ago

If a peer join a group, then leaves the group, and then joins the group again, the shoal framework throws a NullPointException.

Here is the code that produces the problem:

package sample.shoal;

import com.sun.enterprise.ee.cms.core.GMSConstants.shutdownType; import com.sun.enterprise.ee.cms.core.GMSFactory; import com.sun.enterprise.ee.cms.core.GroupManagementService;

public class Sample {

private static final String GROUP_NAME = "MyGroup"; private static final String PEER_NAME = "Peer"; private static final int WAIT_PERIOD = 7000;

public static void main(String[] args) throws Exception

{ GroupManagementService gms = (GroupManagementService) GMSFactory.startGMSModule(PEER_NAME, GROUP_NAME, GroupManagementService.MemberType.CORE, null); gms.join(); Thread.sleep(WAIT_PERIOD); gms.shutdown(shutdownType.INSTANCE_SHUTDOWN); Thread.sleep(WAIT_PERIOD); gms.join(); Thread.sleep(WAIT_PERIOD); gms.shutdown(shutdownType.INSTANCE_SHUTDOWN); Thread.sleep(WAIT_PERIOD); System.exit(0); }

}

And here is the output log:

Jan 19, 2010 3:52:50 PM com.sun.enterprise.ee.cms.impl.jxta.ViewWindow getMemberTokens INFO: GMS View Change Received for group MyGroup : Members in view for MASTER_CHANGE_EVENT(before change analysis) are : 1: MemberId: Peer, MemberType: CORE, Address: urn:jxta:uuid- 59616261646162614A7874615032503384B6AF8DCB384ABA9DB5B80617CF675D03

Jan 19, 2010 3:52:50 PM com.sun.enterprise.ee.cms.impl.jxta.ViewWindow newViewObserved INFO: Analyzing new membership snapshot received as part of event : MASTER_CHANGE_EVENT for Member: Peer of Group: MyGroup Jan 19, 2010 3:52:50 PM com.sun.enterprise.ee.cms.impl.jxta.ViewWindow addGroupLeadershipNotificationSignal INFO: adding GroupLeadershipNotification signal leaderMember: Peer of group: MyGroup Jan 19, 2010 3:52:55 PM com.sun.enterprise.jxtamgmt.ClusterViewManager addToView WARNING: no changes from previous view, skipping notification of listeners for cluster view event MASTER_CHANGE_EVENT from member: Peer group: MyGroup Jan 19, 2010 3:52:55 PM com.sun.enterprise.jxtamgmt.MasterNode appointMasterNode INFO: Assuming Master Node designation member:Peer for group:MyGroup Jan 19, 2010 3:52:57 PM com.sun.enterprise.ee.cms.impl.jxta.GMSContext leave INFO: Leaving GMS group MyGroup with shutdown type set to InstanceShutdown Exception in thread "MessageWindowThread:MyGroup" java.lang.NullPointerException at com.sun.enterprise.ee.cms.impl.jxta.MessageWindow.run(MessageWindow.java:86) at java.lang.Thread.run(Thread.java:619) Jan 19, 2010 3:53:04 PM com.sun.enterprise.ee.cms.impl.jxta.ViewWindow getMemberTokens INFO: GMS View Change Received for group MyGroup : Members in view for MASTER_CHANGE_EVENT(before change analysis) are : 1: MemberId: Peer, MemberType: CORE, Address: urn:jxta:uuid- 59616261646162614A7874615032503384B6AF8DCB384ABA9DB5B80617CF675D03

Jan 19, 2010 3:53:04 PM com.sun.enterprise.ee.cms.impl.jxta.ViewWindow newViewObserved INFO: Analyzing new membership snapshot received as part of event : MASTER_CHANGE_EVENT for Member: Peer of Group: MyGroup Jan 19, 2010 3:53:04 PM com.sun.enterprise.ee.cms.impl.jxta.ViewWindow addGroupLeadershipNotificationSignal INFO: adding GroupLeadershipNotification signal leaderMember: Peer of group: MyGroup Jan 19, 2010 3:53:09 PM com.sun.enterprise.jxtamgmt.ClusterViewManager addToView WARNING: no changes from previous view, skipping notification of listeners for cluster view event MASTER_CHANGE_EVENT from member: Peer group: MyGroup Jan 19, 2010 3:53:09 PM com.sun.enterprise.jxtamgmt.MasterNode appointMasterNode INFO: Assuming Master Node designation member:Peer for group:MyGroup Jan 19, 2010 3:53:11 PM com.sun.enterprise.ee.cms.impl.jxta.GMSContext leave INFO: Leaving GMS group MyGroup with shutdown type set to InstanceShutdown

Environment

Operating System: All Platform: Linux

Affected Versions

[current]

glassfishrobot commented 6 years ago
glassfishrobot commented 14 years ago

@glassfishrobot Commented Reported by dhcavalcanti

glassfishrobot commented 13 years ago

@glassfishrobot Commented @jfialli said: Fixed.

Added a junit regression test in GroupManagementServiceImplTest for this scenario.

glassfishrobot commented 14 years ago

@glassfishrobot Commented Was assigned to shreedhar_ganapathy

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA SHOAL-96

glassfishrobot commented 13 years ago

@glassfishrobot Commented Marked as fixed on Wednesday, October 6th 2010, 11:35:29 pm