tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1547333 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java webapps/docs/changelog.xml
Date Tue, 03 Dec 2013 10:15:54 GMT
Author: kfujino
Date: Tue Dec  3 10:15:54 2013
New Revision: 1547333

URL: http://svn.apache.org/r1547333
Log:
-When the ping timeouted, make sure that memberDisappeared method is not called by specifying
the members that has already been removed.
-Add log message of session relocation when member disappeared.

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1547333&r1=1547332&r2=1547333&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
Tue Dec  3 10:15:54 2013
@@ -278,14 +278,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
@@ -778,6 +776,9 @@ public abstract class AbstractReplicated
             }
         }
 
+        if (log.isInfoEnabled())
+            log.info("Member["+member+"] disappeared. Related map entries will be relocated
to the new node.");
+        long start = System.currentTimeMillis();
         @SuppressWarnings("unchecked")
         Iterator<Map.Entry<?,?>> i = super.entrySet().iterator();
         while (i.hasNext()) {
@@ -826,6 +827,8 @@ public abstract class AbstractReplicated
             }
 
         } //while
+        long complete = System.currentTimeMillis() - start;
+        if (log.isInfoEnabled()) log.info("Relocation of map entries was complete in " +
complete + " ms.");
     }
 
     public int getNextBackupIndex() {

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=1547333&r1=1547332&r2=1547333&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Dec  3 10:15:54 2013
@@ -282,6 +282,14 @@
         <code>org.apache.catalina.ha.session.DeltaManager</code> via JMX.
         (kfujino)
       </fix>
+      <fix>
+        When the ping timeouted, make sure that <code>memberDisappeared</code>
+        method is not called by specifying the members that has already been
+        removed. (kfujino)
+      </fix>
+      <add>
+        Add log message of session relocation when member disappeared. (kfujino)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Web applications">



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


Mime
View raw message