You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/05/03 19:50:43 UTC

[Bug 53186] New: JIoEndpoint LimitLatch will leak if setsockopt is called on a closed socket on Solaris

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.

[Bug 53186] JIoEndpoint LimitLatch will leak if setsockopt is called on a closed socket on Solaris

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53186

--- Comment #1 from Rainer Jung <ra...@kippdata.de> ---
There might be some relation to BZ53173

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

[Bug 53186] JIoEndpoint LimitLatch will leak if setsockopt is called on a closed socket on Solaris

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53186

--- Comment #3 from Pid <bu...@pidster.com> ---
I concur, but I'd suggest we leave it open for Filip to review.

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

[Bug 53186] JIoEndpoint LimitLatch will leak if setsockopt is called on a closed socket on Solaris

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53186

Filip Hanik <fh...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Filip Hanik <fh...@apache.org> ---
That is correct. Thank you for the report. It has been fixed.

https://issues.apache.org/bugzilla/show_bug.cgi?id=53173

*** This bug has been marked as a duplicate of bug 53173 ***

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

[Bug 53186] JIoEndpoint LimitLatch will leak if setsockopt is called on a closed socket on Solaris

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53186

--- Comment #2 from parker0phil <pa...@gmail.com> ---
Yep looks like a different instance of the same problem to me, didn't find that
in my search.

(In reply to comment #1)
> There might be some relation to BZ53173

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