Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51905
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 28 Sep 2011 09:35:59 +0000 (09:35 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 28 Sep 2011 09:35:59 +0000 (09:35 +0000)
Skip attempt to shutdown AprEndpoint acceptor threads if the server socket has been already forcefully closed.
Reduce waiting timeout from 30s to 10s. I think if things go wrong 10s is enough to wait.

If it were waiting 30s
- the JVM itself might be forcefully closed by service wrapper as unresponsive.
- it must print something to the logs, otherwise it looks odd.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1176799 13f79535-47bb-0310-9956-ffa450edef68

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

index 7534cfb..c0b279d 100644 (file)
@@ -652,8 +652,8 @@ public class AprEndpoint extends AbstractEndpoint {
             running = false;
             unlockAccept();
             for (int i = 0; i < acceptors.length; i++) {
-                long s = System.currentTimeMillis() + 30000;
-                while (acceptors[i].isAlive()) {
+                long s = System.currentTimeMillis() + 10000;
+                while (acceptors[i].isAlive() && serverSock != 0) {
                     try {
                         acceptors[i].interrupt();
                         acceptors[i].join(1000);