[ 
https://issues.apache.org/jira/browse/GEODE-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15876836#comment-15876836
 ] 

ASF GitHub Bot commented on GEODE-2497:
---------------------------------------

Github user kirklund commented on a diff in the pull request:

    https://github.com/apache/geode/pull/402#discussion_r102331034
  
    --- Diff: 
geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
 ---
    @@ -159,77 +159,74 @@ public void testConnectAfterBeingShunned() {
        **/
       @Test
       public void testSurpriseMemberHandling() {
    -    VM vm0 = Host.getHost(0).getVM(0);
    -
    -    InternalDistributedSystem sys = getSystem();
    -    MembershipManager mgr = 
MembershipManagerHelper.getMembershipManager(sys);
     
    +    System.setProperty(DistributionConfig.GEMFIRE_PREFIX + 
"surprise-member-timeout", "3000");
         try {
    -      InternalDistributedMember mbr =
    -          new InternalDistributedMember(NetworkUtils.getIPLiteral(), 
12345);
    +      InternalDistributedSystem sys = getSystem();
    +      MembershipManager mgr = 
MembershipManagerHelper.getMembershipManager(sys);
    +      assertTrue(((GMSMembershipManager) mgr).isCleanupTimerStarted());
     
    -      // first make sure we can't add this as a surprise member (bug 
#44566)
    -
    -      // if the view number isn't being recorded correctly the test will 
pass but the
    -      // functionality is broken
    -      Assert.assertTrue("expected view ID to be greater than zero", 
mgr.getView().getViewId() > 0);
    -
    -      int oldViewId = mbr.getVmViewId();
    -      mbr.setVmViewId((int) mgr.getView().getViewId() - 1);
    -      org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
    -          .info("current membership view is " + mgr.getView());
    -      org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
    -          .info("created ID " + mbr + " with view ID " + 
mbr.getVmViewId());
    -      sys.getLogWriter()
    -          .info("<ExpectedException action=add>attempt to add old 
member</ExpectedException>");
    -      sys.getLogWriter()
    -          .info("<ExpectedException action=add>Removing shunned GemFire 
node</ExpectedException>");
           try {
    -        boolean accepted = mgr.addSurpriseMember(mbr);
    -        Assert.assertTrue("member with old ID was not rejected (bug 
#44566)", !accepted);
    -      } finally {
    +        InternalDistributedMember mbr =
    +            new InternalDistributedMember(NetworkUtils.getIPLiteral(), 
12345);
    +
    +        // first make sure we can't add this as a surprise member (bug 
#44566)
    +
    +        // if the view number isn't being recorded correctly the test will 
pass but the
    +        // functionality is broken
    +        Assert.assertTrue("expected view ID to be greater than zero",
    +            mgr.getView().getViewId() > 0);
    +
    +        int oldViewId = mbr.getVmViewId();
    +        mbr.setVmViewId((int) mgr.getView().getViewId() - 1);
    +        org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
    +            .info("current membership view is " + mgr.getView());
    +        org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
    +            .info("created ID " + mbr + " with view ID " + 
mbr.getVmViewId());
             sys.getLogWriter()
    -            .info("<ExpectedException action=remove>attempt to add old 
member</ExpectedException>");
    +            .info("<ExpectedException action=add>attempt to add old 
member</ExpectedException>");
             sys.getLogWriter().info(
    -            "<ExpectedException action=remove>Removing shunned GemFire 
node</ExpectedException>");
    -      }
    -      mbr.setVmViewId(oldViewId);
    -
    -      // now forcibly add it as a surprise member and show that it is 
reaped
    -      long gracePeriod = 5000;
    -      long startTime = System.currentTimeMillis();
    -      long timeout = ((GMSMembershipManager) 
mgr).getSurpriseMemberTimeout();
    -      long birthTime = startTime - timeout + gracePeriod;
    -      MembershipManagerHelper.addSurpriseMember(sys, mbr, birthTime);
    -      assertTrue("Member was not a surprise member", 
mgr.isSurpriseMember(mbr));
    -
    -      // force a real view change
    -      SerializableRunnable connectDisconnect = new SerializableRunnable() {
    -        public void run() {
    -          getSystem().disconnect();
    +            "<ExpectedException action=add>Removing shunned GemFire 
node</ExpectedException>");
    +        try {
    +          boolean accepted = mgr.addSurpriseMember(mbr);
    +          Assert.assertTrue("member with old ID was not rejected (bug 
#44566)", !accepted);
    +        } finally {
    +          sys.getLogWriter().info(
    +              "<ExpectedException action=remove>attempt to add old 
member</ExpectedException>");
    --- End diff --
    
    That's actually adding our custom IgnoredException. The purpose was to 
ignore these exceptions if they show up in the logs but not to Expect them in 
the same way as JUnit Expected Exceptions. We updated the Java API to "Ignored" 
(to differentiate it from JUnit's EE) but left the XML as "Expected" -- we 
should update the XML strings to match the Java code.


> surprise members are never timed out during startup
> ---------------------------------------------------
>
>                 Key: GEODE-2497
>                 URL: https://issues.apache.org/jira/browse/GEODE-2497
>             Project: Geode
>          Issue Type: Bug
>          Components: membership
>            Reporter: Bruce Schuchardt
>            Assignee: Bruce Schuchardt
>
> A system was observed to hang during startup when a "surprise member" was 
> added but then never timed out.  The system hung waiting for a response to a 
> startup message sent to the surprise member.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to