tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1547327 - /tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
Date Tue, 03 Dec 2013 09:48:36 GMT
Author: kfujino
Date: Tue Dec  3 09:48:36 2013
New Revision: 1547327

URL: http://svn.apache.org/r1547327
Log:
When the ping timeouted, make sure that memberDisappeared method is not called by specifying
the members that has already been removed.

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1547327&r1=1547326&r2=1547327&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java Tue Dec
 3 09:48:36 2013
@@ -273,14 +273,12 @@ public abstract class AbstractReplicated
         }
         //update our map of members, expire some if we didn't receive a ping back
         synchronized (mapMembers) {
-            Iterator<Map.Entry<Member, Long>> it = mapMembers.entrySet().iterator();
+            Member[] members = mapMembers.keySet().toArray(new Member[mapMembers.size()]);
             long now = System.currentTimeMillis();
-            while ( it.hasNext() ) {
-                Map.Entry<Member,Long> entry = it.next();
-                long access = entry.getValue().longValue();
+            for (Member member : members) {
+                long access = mapMembers.get(member);
                 if ( (now - access) > timeout ) {
-                    it.remove();
-                    memberDisappeared(entry.getKey());
+                    memberDisappeared(member);
                 }
             }
         }//synch



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


Mime
View raw message