tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1709722 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java webapps/docs/changelog.xml
Date Wed, 21 Oct 2015 05:53:02 GMT
Author: kfujino
Date: Wed Oct 21 05:53:02 2015
New Revision: 1709722

URL: http://svn.apache.org/viewvc?rev=1709722&view=rev
Log:
Distinguish the handling of the shutdown payload and member verification clearly.
When handling shutdown payload, verification completion message is not required.

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java?rev=1709722&r1=1709721&r2=1709722&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
Wed Oct 21 05:53:02 2015
@@ -146,38 +146,47 @@ public class TcpFailureDetector extends
         if ( membership == null ) setupMembership();
         boolean notify = false;
         boolean shutdown = Arrays.equals(member.getCommand(),Member.SHUTDOWN_PAYLOAD);
-        if ( !shutdown )
-            if(log.isInfoEnabled())
-                log.info("Received memberDisappeared["+member+"] message. Will verify.");
-        synchronized (membership) {
-            if (!membership.contains(member)) {
-                if(log.isInfoEnabled())
-                    log.info("Verification complete. Member already disappeared["+member+"]");
-                return;
-            }
-            //check to see if the member really is gone
-            //if the payload is not a shutdown message
-            if (shutdown || !memberAlive(member)) {
-                //not correct, we need to maintain the map
+        if (shutdown) {
+            synchronized (membership) {
+                if (!membership.contains(member)) return;
                 membership.removeMember( (MemberImpl) member);
                 removeSuspects.remove(member);
                 if (member instanceof StaticMember) {
                     addSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
                 }
-                notify = true;
-            } else {
-                //add the member as suspect
-                removeSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
             }
-        }
-        if ( notify ) {
-            if(log.isInfoEnabled())
-                log.info("Verification complete. Member disappeared["+member+"]");
             super.memberDisappeared(member);
         } else {
             if(log.isInfoEnabled())
-                log.info("Verification complete. Member still alive["+member+"]");
-
+                log.info("Received memberDisappeared["+member+"] message. Will verify.");
+            synchronized (membership) {
+                if (!membership.contains(member)) {
+                    if(log.isInfoEnabled())
+                        log.info("Verification complete. Member already disappeared["+member+"]");
+                    return;
+                }
+                //check to see if the member really is gone
+                if (!memberAlive(member)) {
+                    //not correct, we need to maintain the map
+                    membership.removeMember( (MemberImpl) member);
+                    removeSuspects.remove(member);
+                    if (member instanceof StaticMember) {
+                        addSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
+                    }
+                    notify = true;
+                } else {
+                    //add the member as suspect
+                    removeSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
+                }
+            }
+            if ( notify ) {
+                if(log.isInfoEnabled())
+                    log.info("Verification complete. Member disappeared["+member+"]");
+                super.memberDisappeared(member);
+            } else {
+                if(log.isInfoEnabled()) 
+                    log.info("Verification complete. Member still alive["+member+"]");
+            }
         }
     }
 

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1709722&r1=1709721&r2=1709722&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Oct 21 05:53:02 2015
@@ -66,6 +66,15 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Tribes">
+    <changelog>
+      <scode>
+        Distinguish the handling of the shutdown payload and member verification
+        clearly. When handling shutdown payload, verification completion message
+        is not required. (kfujino)
+      </scode>
+    </changelog>
+  </subsection>
   <subsection name="jdbc-pool">
     <changelog>
       <fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message