Use absolute time spend to unlockAccept and lower down the timeout to 30 secs
authormturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 4 Oct 2010 09:37:11 +0000 (09:37 +0000)
committermturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 4 Oct 2010 09:37:11 +0000 (09:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1004168 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/AprEndpoint.java

index 33b9772..4ecb2f6 100644 (file)
@@ -610,7 +610,7 @@ public class AprEndpoint extends AbstractEndpoint {
             running = false;
             unlockAccept();
             for (int i = 0; i < acceptors.length; i++) {
-                int c = 0;
+                long s = System.currentTimeMillis() + 30000;
                 while (acceptors[i].isAlive()) {
                     try {
                         acceptors[i].interrupt();
@@ -618,7 +618,7 @@ public class AprEndpoint extends AbstractEndpoint {
                     } catch (InterruptedException e) {
                         // Ignore
                     }
-                    if (c++ > 60) {
+                    if (System.currentTimeMillis() >= s) {
                         log.warn(sm.getString("endpoint.warn.unlockAcceptorFailed",
                                  acceptors[i].getName()));
                         // If the Acceptor is still running force