cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Giger (JIRA)" <>
Subject [jira] [Created] (CXF-4733) AsyncHTTPConduit threading issue
Date Tue, 08 Jan 2013 12:54:12 GMT
Marc Giger created CXF-4733:

             Summary: AsyncHTTPConduit threading issue
                 Key: CXF-4733
             Project: CXF
          Issue Type: Bug
          Components: Transports
    Affects Versions: 2.7.1
            Reporter: Marc Giger


I get the following exception

Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
        at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(
        ... 31 more

under following conditions:

- httpClientPolicy.setConnection(ConnectionType.CLOSE);
- massive parallel invocations
- SSL/TLS transport (from my analysis it seems to be independent if transport security is
active or not but the issue can only be reproduced with SSL enabled and also then occurs just

>From my understanding the folllowing happens:

The AsyncHTTPConduit leases a pooled connection, invokes the endpoint, consumes the response
and returns the connection to the pool. Because the client requested that the connection must
be closed by the server (ConnectionType.CLOSE) the released connection is closed. A new AsyncHTTPConduit
leases the closed connection from the pool. On first use of this (closed) connection an exception
will be thrown that the connection is closed and a new one will be created (handled internally
by hc). The AsyncHTTPConduit will be informed about the exception with the registered callback:

FutureCallback<Boolean> callback = new FutureCallback<Boolean>() {

                public void completed(Boolean result) {
                public void failed(Exception ex) {
                public void cancelled() {

Here, if an exception happend, inbuf.shutdown() is called which itself sets the this.shutdown
= true; flag in the SharedInputBuffer.

During the same time another thread? continues with a fresh connection and hits the 

public int read() throws IOException {
        if (this.shutdown) {
            return -1;

in the same SharedInputBuffer instance which returns -1. 
This seems to be the cause for the above exception.

Just for testing purposes I replaced the statement
this.shutdown = true;
this.shutdown = false;

This change seems to "fix" the issue I have. I don't know how a proper fix should look like
so I can't provide a patch. Sorry.



This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message