Summary: | HTTP NIO connector: SocketExceptions and performance degradation due to JVM default not being respected for socket linger option | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | David <david.lander> |
Component: | Connectors | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | critical | ||
Priority: | P2 | ||
Version: | 7.0.53 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
David
2014-04-16 16:11:20 UTC
Fixed in 8.0.x for 8.0.6 onwards and in 7.0.x for 7.0.54 onwards. Removing the default broke lots of stuff. Further explicitly disabling socket linger is a sensible default for a web server. The docs will be updated to reflect the actual default. A possible work around for Solaris is to specify values for socket linger that Solaris finds acceptable. Docs updated for 8.0.x for 8.0.6 and 7.0.x for 7.0.54. Mark, On my end we have the following scenario: 1) Start Tomcat 2) Tomcat binds to port and starts loading webapps 3) My web app has a servlet for which load-on-startup is set to True. Tomcat starts to load the servlet. 4) While Tomcat is loading the servlet, client establishes a TCP connection and sends a TCP request. 5) Tomcat is still loading the load-on-startup servlet, so the TCP request sits in the OS buffer. 6) Client gets fed up and closes the TCP connection. 7) Tomcat finishes loading the load-on-startup servlet. 8) Tomcat Acceptor thread starts accepting TCP requests that have built up in the OS buffer 9) Tomcat tries to set various properties on the socket. The problem is that the CLIENT HAS ALREADY CLOSED THE CONNECTION (SEE STEP 7) Result: SocketExceptions in Tomcat log file. Should the above be logged in a separate bug or do you have any other insight. Thanks, David (In reply to David from comment #4) > On my end we have the following scenario: <snip/> Bugzilla is not a support forum. This question belongs on the Tomcat users mailing list. (In reply to David from comment #4) First, that would better be tracked as a separate issue. Second, it cannot be said much without knowing your Tomcat version and stacktrace of the error. JioEndpoint and AprEndpoint implementations of setSocketOptions() log socket exceptions at debug level (the latter logs all errors at debug level). NioEndpoint, Nio2Endpoint implementations of setSocketOptions() may need a fix. |