svn commit: r1846181 - in /tomcat/trunk/java/org/apache: catalina/core/ContainerBase.java catalina/tribes/group/GroupChannel.java coyote/AbstractProtocol.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1846181 - in /tomcat/trunk/java/org/apache: catalina/core/ContainerBase.java catalina/tribes/group/GroupChannel.java coyote/AbstractProtocol.java

Rémy Maucherat
Author: remm
Date: Thu Nov  8 18:51:16 2018
New Revision: 1846181

URL: http://svn.apache.org/viewvc?rev=1846181&view=rev
Log:
Simplify code.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
    tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java
    tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1846181&r1=1846180&r2=1846181&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Thu Nov  8 18:51:16 2018
@@ -936,11 +936,10 @@ public abstract class ContainerBase exte
         setState(LifecycleState.STARTING);
 
         // Start our thread
-        threadStart();
         if (backgroundProcessorDelay > 0) {
             monitorFuture = Container.getService(ContainerBase.this)
                     .getUtilityExecutor().scheduleWithFixedDelay(
-                            new ContainerBackgroundProcessorMonitor(), 60, 60, TimeUnit.SECONDS);
+                            new ContainerBackgroundProcessorMonitor(), 0, 60, TimeUnit.SECONDS);
         }
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java?rev=1846181&r1=1846180&r2=1846181&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java Thu Nov  8 18:51:16 2018
@@ -479,26 +479,23 @@ public class GroupChannel extends Channe
             ownExecutor = true;
         }
         super.start(svc);
-        startHeartbeat();
         monitorFuture = utilityExecutor.scheduleWithFixedDelay(
                 new Runnable() {
                     @Override
                     public void run() {
                         startHeartbeat();
                     }
-                }, 60, 60, TimeUnit.SECONDS);
+                }, 0, 60, TimeUnit.SECONDS);
     }
 
     protected void startHeartbeat() {
         if (heartbeat && (heartbeatFuture == null || (heartbeatFuture != null && heartbeatFuture.isDone()))) {
             if (heartbeatFuture != null && heartbeatFuture.isDone()) {
-                if (heartbeatFuture != null && heartbeatFuture.isDone()) {
-                    // There was an error executing the scheduled task, get it and log it
-                    try {
-                        heartbeatFuture.get();
-                    } catch (InterruptedException | ExecutionException e) {
-                        log.error(sm.getString("groupChannel.unable.sendHeartbeat"), e);
-                    }
+                // There was an error executing the scheduled task, get it and log it
+                try {
+                    heartbeatFuture.get();
+                } catch (InterruptedException | ExecutionException e) {
+                    log.error(sm.getString("groupChannel.unable.sendHeartbeat"), e);
                 }
             }
             heartbeatFuture = utilityExecutor.scheduleWithFixedDelay(new HeartbeatRunnable(),

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1846181&r1=1846180&r2=1846181&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Thu Nov  8 18:51:16 2018
@@ -566,7 +566,6 @@ public abstract class AbstractProtocol<S
         }
 
         endpoint.start();
-        startAsyncTimeout();
         monitorFuture = getUtilityExecutor().scheduleWithFixedDelay(
                 new Runnable() {
                     @Override
@@ -575,7 +574,7 @@ public abstract class AbstractProtocol<S
                             startAsyncTimeout();
                         }
                     }
-                }, 60, 60, TimeUnit.SECONDS);
+                }, 0, 60, TimeUnit.SECONDS);
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]