shoal
  1. shoal
  2. SHOAL-96

Re-joining a group throws a NPE exception.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: 1.1
    • Component/s: GMS
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      96

      Description

      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

        Activity

        Hide
        Joe Fialli added a comment -

        Fixed.

        Added a junit regression test in GroupManagementServiceImplTest for this scenario.

        Show
        Joe Fialli added a comment - Fixed. Added a junit regression test in GroupManagementServiceImplTest for this scenario.

          People

          • Assignee:
            shreedhar_ganapathy
            Reporter:
            dhcavalcanti
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: