With 7.0.18 packaged as a candidate for release and finally unreleased, when I stop the Tomcat service (only 1 war deployed), the service takes a lot of time to stop and finally was killed by system. Having a look into the stderr log, I see it paused right after the folowing line : INFO: Stopping ProtocolHandler [http-apr-0] Then went into a slow loop and fill the log with these lines : 13 juil. 2011 14:30:30 org.apache.tomcat.util.net.AprEndpoint stopInternal ATTENTION: Acceptor thread [http-apr-0-Acceptor-0] failed to unlock. Forcing hard socket shutdown. 13 juil. 2011 14:30:31 org.apache.tomcat.util.net.AprEndpoint stopInternal ATTENTION: Acceptor thread [http-apr-0-Acceptor-0] failed to unlock. Forcing hard socket shutdown. 13 juil. 2011 14:30:32 org.apache.tomcat.util.net.AprEndpoint stopInternal ATTENTION: Acceptor thread [http-apr-0-Acceptor-0] failed to unlock. Forcing hard socket shutdown. etc. (about 30 times before it was killed) I think there was no such issue with 7.0.16.
This has already been fixed in trunk and will be included in 7.0.19 onwards.
I got the same issue with 7.0.19; please also note that my HTTP connector is disabled in server.xml.
This report makes no sense. If the http connector is disabled then there won't be any http acceptor threads.
Got it : It happens when I remove the 8080 HTTP port value at installation time. I thought that the installer then would comment the HTTP connector part in the server.xml, but actually, it just wrote port="". I guess you should consider adding a check that the port number value should not be empty to prevent the user to be misled as I was.
BTW, there is no error logged at server startup, is the port="" syntax legal ?
OK, that makes a lot more sense. Looks like some
... additional checks are required.
The additional validation has been added to 7.0.x and will be included in 7.0.20 onwards.
Created attachment 33416 [details] catalina.2016-01-07.log I reviewed the fix (r1147949) with the question of backporting it to current Tomcat 6, while working on bug 52028. The current behaviour of Tomcat 6: 1). The installer part of the fix r1147949 (tomcat.nsi) has already been backported to Tomcat 6. I tested installer for 6.0.44. It has this feature and works well. 2). The message "Acceptor thread .. failed to unlock." from Comment 0 is observed when running with APR connector. I tested the current 6.0.x/trunk (6.0.45-dev) With APR connectors there is a delay of 10 seconds for each connector during Tomcat shutdown. The message is printed only once, not 30 times. > 07.01.2016 8:04:54 org.apache.tomcat.util.net.AprEndpoint stop > WARNING: Acceptor thread [http-0-Acceptor-0] failed to unlock. Forcing hard socket shutdown. There is no message when running with BIO connectors, and there are no delays during shutdown. Thus only APR connectors are affected. I will attach the logs, for a reference. My conclusion: 1). It is worth fixing AprEndpoint so that it does not try connecting to a wrong port number and does not print that message. I think the AprEndpoint issue will be addressed under bug 52028 / r1208115. 2). It is worth protecting from missing port number, but it is not worth rejecting the port number of 0 like r1147949 does. The value of 0 may be a valid use case now, and it will be a valid use case once bug 52028 is implemented. Tomcat 7 (since r1207695) uses the default of -1.
Implemented in Tomcat 6 by r1723466 and will be in 6.0.45 onwards.
Created attachment 33417 [details] catalina.2016-01-07.log (2) The log from testing the implemented feature. For a reference. Tomcat 6 @r1723466