tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r399092 - /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
Date Tue, 02 May 2006 23:51:04 GMT
Author: fhanik
Date: Tue May  2 16:51:02 2006
New Revision: 399092

URL: http://svn.apache.org/viewcvs?rev=399092&view=rev
Log:
More coding, still need to complete the heartbeat() to make sure there isn't a leak

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java?rev=399092&r1=399091&r2=399092&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
Tue May  2 16:51:02 2006
@@ -94,8 +94,10 @@
     
     public synchronized void memberAdded(Member member) {
         if ( membership == null ) setupMembership();
-        if ( suspect.containsKey(member) ) suspect.remove(member);
-        else {
+        if ( suspect.containsKey(member) ) {
+            //previously marked suspect, system below picked up the member again
+            suspect.remove(member);
+        } else {
             //not correct, this could make the membership out of sync
             membership.addMember((MemberImpl)member);
             super.memberAdded(member);
@@ -110,11 +112,15 @@
             //not correct, we need to maintain the map
             membership.removeMember((MemberImpl)member);
             super.memberDisappeared(member);
-        } else suspect.put(member,new Long(System.currentTimeMillis()));
+        } else {
+            //add the member as suspect
+            suspect.put(member, new Long(System.currentTimeMillis()));
+        }
     }
     
     public boolean hasMembers() {
-        return super.hasMembers();
+        if ( membership == null ) setupMembership();
+        return membership.hasMembers();
     }
 
     public Member[] getMembers() {
@@ -123,7 +129,8 @@
     }
 
     public Member getMember(Member mbr) {
-        return super.getMember(mbr);
+        if ( membership == null ) setupMembership();
+        return membership.getMember(mbr);
     }
 
     public Member getLocalMember(boolean incAlive) {
@@ -133,7 +140,6 @@
     public void heartbeat() {
         //todo, implement an expiration of members that we deemed alive
         //check them again and act accordingly
-        
         super.heartbeat();
     }
     



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


Mime
View raw message