Hi everyone,

All the issues relatives to AXIS2-935 are really messy, some of them are
closed but their clones are not. Some are flagged as fixed but are obviously
not. All these issues are really old, so I'd like to take a chance to bring
them back to your attention, especially before releasing 1.5.

I'll post a description of the issue in this email as a summary all the
jiras.

By default, ServiceClient uses one HttpConnectionManager per invocation [2].
This connection manager will create and provide one connection to
HTTPSender. The first issue is that by default this connection is never
released to the pool [3]. if you do zillions of invocations, this leak will
max out your number of file descriptors.

Your investigations in Axis2 options quickly lead you to the
REUSE_HTTP_CLIENT option. But this first issue has some unfortunate
consequences if you activate it. Actually if you do so, a single connection
manager is shared across all invocations. But because connections are not
release, the pool is starved after two invocations, and the third invocation
hangs out indefinitely. :(

If you keep digging you will find the AUTO_RELEASE_CONNECTION option. Its
sounds like a good lead! Let's try it. If you activate this option the
connection is properly released -Yahoooo! the leak is fixed - but
unfortunately a new issue shows up (issue #2, aka AXIS2-3478).
AbstractHTTPSender passes the stream of the connection to the message
context [4] , but that the connection is now properly released, so this
stream is closed before the SOAPBuilder gets a chance to read the response
body.
Boom! "IOException: Attempted read on closed stream"

These issues are easily reproducible in versions 1.3, 1.4, 1.5.

I submitted and documented a fix in AXIS2-2931 [5], if you had a chance to
look at it that would be much appreciate.


Alexis


[1]
https://issues.apache.org/jira/browse/AXIS2-935?focusedCommentId=12513543#action_12513543
[2] see method getHttpClient in
https://svn.apache.org/repos/asf/webservices/commons/trunk/modules/transport/modules/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
[3] see method cleanup in
https://svn.apache.org/repos/asf/webservices/commons/trunk/modules/transport/modules/http/src/org/apache/axis2/transport/http/HTTPSender.java
[4] see method processResponse in AbstractHTTPSender.java
[5]
https://issues.apache.org/jira/browse/AXIS2-2931?focusedCommentId=12676837#action_12676837

Reply via email to