tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53186] New: JIoEndpoint LimitLatch will leak if setsockopt is called on a closed socket on Solaris
Date Thu, 03 May 2012 17:50:43 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53186

          Priority: P2
            Bug ID: 53186
          Assignee: dev@tomcat.apache.org
           Summary: JIoEndpoint LimitLatch will leak if setsockopt is
                    called on a closed socket on Solaris
          Severity: normal
    Classification: Unclassified
                OS: Solaris
          Reporter: parker.p.dev@gmail.com
          Hardware: Sun
            Status: NEW
           Version: 7.0.20
         Component: Connectors
           Product: Tomcat 7

Overview Description:

org.apache.tomcat.util.net.AbstractEndpoint uses a
org.apache.tomcat.util.threads.LimitLatch to limit the amount of connections to
whatever was set using the maxConnections property of the connector.

In the org.apache.tomcat.util.net.JIoEndpoint implementation this is
incremented as part of the main Acceptor run method (JIoEndpoint:204) but only
decremented during a specific case of SocketProcessor.run()(JIoEndpoint:310).

If for any reason line 310 does not execute then, over time, the limitlatch
will steadily increment with no possibility of decrementing. Until the limit is
reached and no more connections can be serviced.

In my particular case the problem occurs when the setSocketOptions method is
called (JIoEndpoint:221) and the native implementation of PlainSocketImpl
causes an error due to the socket being closed (as described in the comment on
line 942 of
http://cr.openjdk.java.net/~chegar/6882910/webrev.00/webrev/src/solaris/native/java/net/PlainSocketImpl.c.frames.html)

Steps to Reproduce: 

Can't reproduce in isolation (due to unknown root cause creating initial error
in native code). Reproducible under load in Performance and Production
environments.

Reading the code shows a number of possible reasons why this COULD happen.

Actual Results: 

The container stops responding to requests. 

The process continues to run and scheduled tasks etc will continue occuring and
logging. Can't even telnet to the port (as the Acceptor thread is blocked by
the LimitLatch).

Additional Builds and Platforms:

 - Occurs On
        Solaris 

 - Doesn't Occur On
        Linux (although I would expect any other intermittent exception in
JIoEndpointsetSocketOptions or JIoEndpoint$SocketProcessor.run() to produce the
same result on any platform)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message