You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/12/17 09:27:51 UTC

svn commit: r1551482 - /tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java

Author: markt
Date: Tue Dec 17 08:27:50 2013
New Revision: 1551482

URL: http://svn.apache.org/r1551482
Log:
Avoid a warning that executor hasn't shutdown yet if the endpoint is not configured to wait for the executor to shutdown. (BIO is configured not to wait by default as threads in keep-alive can't be interrupted.)

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1551482&r1=1551481&r2=1551482&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Tue Dec 17 08:27:50 2013
@@ -521,14 +521,16 @@ public abstract class AbstractEndpoint<S
                 //this is our internal one, so we need to shut it down
                 ThreadPoolExecutor tpe = (ThreadPoolExecutor) executor;
                 tpe.shutdownNow();
-                try {
-                    tpe.awaitTermination(getExecutorTerminationTimeoutMillis(),
-                            TimeUnit.MILLISECONDS);
-                } catch (InterruptedException e) {
-                    // Ignore
-                }
-                if (tpe.isTerminating()) {
-                    getLog().warn(sm.getString("endpoint.warn.executorShutdown", getName()));
+                long timeout = getExecutorTerminationTimeoutMillis();
+                if (timeout > 0) {
+                    try {
+                        tpe.awaitTermination(timeout, TimeUnit.MILLISECONDS);
+                    } catch (InterruptedException e) {
+                        // Ignore
+                    }
+                    if (tpe.isTerminating()) {
+                        getLog().warn(sm.getString("endpoint.warn.executorShutdown", getName()));
+                    }
                 }
                 TaskQueue queue = (TaskQueue) tpe.getQueue();
                 queue.setParent(null);



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