IF the application is shutting down, we don't need to print the WARN message
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 24 Dec 2008 19:41:22 +0000 (19:41 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 24 Dec 2008 19:41:22 +0000 (19:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@729364 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/tribes/membership/McastServiceImpl.java

index ea629e4..db53e7a 100644 (file)
@@ -429,12 +429,14 @@ public class McastServiceImpl
                 } catch ( Exception x ) {
                     if (x instanceof InterruptedException) interrupted();
                     else {
-                        if (errorCounter==0) log.warn("Error receiving mcast package. Sleeping 500ms",x);
-                        else log.debug("Error receiving mcast package. Sleeping 500ms",x);
-                        try { Thread.sleep(500); } catch ( Exception ignore ){}
-                        if ( (++errorCounter)>=recoveryCounter ) {
-                            errorCounter=0;
-                            new RecoveryThread(McastServiceImpl.this);
+                        if (errorCounter==0 && doRunReceiver) log.warn("Error receiving mcast package. Sleeping 500ms",x);
+                        else if (log.isDebugEnabled()) log.debug("Error receiving mcast package"+(doRunReceiver?". Sleeping 500ms":"."),x);
+                        if (doRunReceiver) {
+                            try { Thread.sleep(500); } catch ( Exception ignore ){}
+                            if ( (++errorCounter)>=recoveryCounter ) {
+                                errorCounter=0;
+                                new RecoveryThread(McastServiceImpl.this);
+                            }
                         }
                     }
                 }