This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit cf558b6a0c1d526e496c3033cb9afcb0b46196a2
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu May 16 13:54:25 2019 +0100

    Avoid unnecessary logging when host is down
---
 .../tribes/group/interceptors/TcpFailureDetector.java         |  9 ++++++---
 webapps/docs/changelog.xml                                    | 11 +++++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git 
a/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java 
b/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
index 8b00a6a..0d458cc 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
+++ b/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
@@ -19,6 +19,7 @@ package org.apache.catalina.tribes.group.interceptors;
 import java.net.ConnectException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.net.NoRouteToHostException;
 import java.net.Socket;
 import java.net.SocketTimeoutException;
 import java.util.Arrays;
@@ -184,7 +185,7 @@ public class TcpFailureDetector extends 
ChannelInterceptorBase {
                     log.info("Verification complete. Member 
disappeared["+member+"]");
                 super.memberDisappeared(member);
             } else {
-                if(log.isInfoEnabled()) 
+                if(log.isInfoEnabled())
                     log.info("Verification complete. Member still 
alive["+member+"]");
             }
         }
@@ -354,9 +355,11 @@ public class TcpFailureDetector extends 
ChannelInterceptorBase {
                 }
             }//end if
             return true;
-        } catch ( SocketTimeoutException sx) {
+        } catch (SocketTimeoutException sx) {
+            //do nothing, we couldn't connect
+        } catch (ConnectException cx) {
             //do nothing, we couldn't connect
-        } catch ( ConnectException cx) {
+        } catch (NoRouteToHostException nre) {
             //do nothing, we couldn't connect
         }catch (Exception x ) {
             log.error("Unable to perform failure detection check, assuming 
member down.[" + mbr + "]",x);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a5c3948..972ada6 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -126,6 +126,17 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Tribes">
+    <changelog>
+      <fix>
+        Treat <code>NoRouteToHostException</code> the same way as
+        <code>SocketTimeoutException</code> when checking the health of group
+        members. This avoids a SEVERE log message every time the check is
+        performed when the host associated with a group member is not powered
+        on. (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <add>


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

Reply via email to