tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1402110 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java webapps/docs/changelog.xml
Date Thu, 25 Oct 2012 11:54:22 GMT
Author: kfujino
Date: Thu Oct 25 11:54:21 2012
New Revision: 1402110

URL: http://svn.apache.org/viewvc?rev=1402110&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54045.
Make sure getMembers() returns available member when TcpFailureDetector works in static cluster.


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=1402110&r1=1402109&r2=1402110&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
Thu Oct 25 11:54:21 2012
@@ -36,6 +36,7 @@ import org.apache.catalina.tribes.io.Cha
 import org.apache.catalina.tribes.io.XByteBuffer;
 import org.apache.catalina.tribes.membership.MemberImpl;
 import org.apache.catalina.tribes.membership.Membership;
+import org.apache.catalina.tribes.membership.StaticMember;
 
 /**
  * <p>Title: A perfect failure detector </p>
@@ -157,6 +158,9 @@ public class TcpFailureDetector extends 
                 //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
@@ -228,6 +232,9 @@ public class TcpFailureDetector extends 
                 if (membership.getMember(members[i])!=null) {
                     membership.removeMember((MemberImpl)members[i]);
                     removeSuspects.remove(members[i]);
+                    if (members[i] instanceof StaticMember) {
+                        addSuspects.put(members[i], Long.valueOf(System.currentTimeMillis()));
+                    }
                     super.memberDisappeared(members[i]);
                 }
             } //end if
@@ -239,6 +246,10 @@ public class TcpFailureDetector extends 
         //update all alive times
         Member[] members = super.getMembers();
         for (int i = 0; members != null && i < members.length; i++) {
+            if (addSuspects.containsKey(members[i]) && membership.getMember(members[i])
== null) {
+                // avoid temporary adding member.
+                continue;
+            }
             if (membership.memberAlive( (MemberImpl) members[i])) {
                 //we don't have this one in our membership, check to see if he/she is alive
                 if (memberAlive(members[i])) {

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=1402110&r1=1402109&r2=1402110&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Oct 25 11:54:21 2012
@@ -102,6 +102,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Tribes">
+    <changelog>
+      <fix>
+        <bug>54045</bug>: Make sure getMembers() returns available member when
+        TcpFailureDetector works in static cluster. (kfujino)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 7.0.32 (markt)" rtext="2012-10-09">
   <subsection name="Catalina">



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


Mime
View raw message