Author: markt
Date: Mon Sep 27 13:00:56 2010
New Revision: 1001720

URL: http://svn.apache.org/viewvc?rev=1001720&view=rev
Log:
When a cluster node disappears when using the backup manager, handle the failed 
ping message rather than propagating the exception (which just logs the stack 
trace but doesn't do anything to deal with the failure)

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

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1001720&r1=1001719&r2=1001720&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep 27 13:00:56 2010
@@ -138,14 +138,6 @@ PATCHES PROPOSED TO BACKPORT:
    but from debugging it looks that it is called by Tomcat code only
    (JspServlet).
 
-* When a cluster node disappears when using the backup manager, handle the
-  failed ping message rather than propagating the exception (which just logs 
the
-  stack trace but doesn't do anything to deal with the failure)
-  http://svn.apache.org/viewvc?rev=993007&view=rev
-  +1: markt, kfujino, kkolinko
-  -1:
-   kkolinko: s/membersq/members/ in a comment
-
 * Make sure Contexts defined in server.xml pick up any configClass setting from
   the parent Host.
   http://people.apache.org/~markt/patches/2010-09-11-configClass.patch

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1001720&r1=1001719&r2=1001720&view=diff
==============================================================================
--- 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
 (original)
+++ 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
 Mon Sep 27 13:00:56 2010
@@ -33,6 +33,7 @@ import java.util.Set;
 
 import org.apache.catalina.tribes.Channel;
 import org.apache.catalina.tribes.ChannelException;
+import org.apache.catalina.tribes.ChannelException.FaultyMember;
 import org.apache.catalina.tribes.ChannelListener;
 import org.apache.catalina.tribes.Heartbeat;
 import org.apache.catalina.tribes.Member;
@@ -253,6 +254,7 @@ public abstract class AbstractReplicated
                                         channel.getLocalMember(false),
                                         null);
         if ( channel.getMembers().length > 0 ) {
+            try {
             //send a ping, wait for all nodes to reply
             Response[] resp = rpcChannel.send(channel.getMembers(), 
                                               msg, rpcChannel.ALL_REPLY, 
@@ -260,7 +262,14 @@ public abstract class AbstractReplicated
                                               (int) accessTimeout);
             for (int i = 0; i < resp.length; i++) {
                 memberAlive(resp[i].getSource());
-            } //for
+                }
+            } catch (ChannelException ce) {
+                // Handle known failed members
+                FaultyMember[] faultyMembers = ce.getFaultyMembers();
+                for (FaultyMember faultyMember : faultyMembers) {
+                    memberDisappeared(faultyMember.getMember());
+                }
+            }            
         }
         //update our map of members, expire some if we didn't receive a ping 
back
         synchronized (mapMembers) {

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1001720&r1=1001719&r2=1001720&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon Sep 27 13:00:56 2010
@@ -117,6 +117,12 @@
       <fix>
         Add Null check when CHANGE_SESSION_ID message received. (kfujino)
       </fix>
+      <fix>
+        When a cluster node disappears when using the backup manager, handle 
the
+        failed ping message rather than propagating the exception (which just
+        logs the stack trace but doesn't do anything to deal with the failure).
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Webapps">



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

Reply via email to