synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SYNAPSE-479) Failure in REST test case
Date Tue, 23 Dec 2008 20:46:44 GMT

    [ https://issues.apache.org/jira/browse/SYNAPSE-479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658947#action_12658947
] 

Andreas Veithen commented on SYNAPSE-479:
-----------------------------------------

What happens here is that Synapse hangs in ContentInputStream#close(), called from ServerWorker#run().
The close method looks as follows:

    public void close() throws IOException {
        // read and discard the remainder of the message
        byte tmp[] = new byte[1024];
        while (this.buffer.read(tmp, 0, tmp.length) >= 0) {
        }
        super.close();
    }

This method has been added in r636863 to "[fix] handling of requests with partially consumed
content". Note that in the present case the transport is processing a GET request which by
definition has no content. It appears that ServerHandler#requestReceived always creates an
input buffer and a ContentInputStream independently of the type of request. The solution is
to check the type of request and only create the input buffer and ContentInputStream if necessary
and of course only use ContentInputStream#close() if the input stream is not null.


> Failure in REST test case
> -------------------------
>
>                 Key: SYNAPSE-479
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-479
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: NIGHTLY
>         Environment: - Hudson
> - Mac OS X
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>            Priority: Minor
>         Attachments: 01-debug.log
>
>
> The following test case systematically fails:
> org.apache.synapse.transport.nhttp.HttpCoreNIOListenerTest.0076:test=REST,client=java.net,endpoint=axis
> This test case uses a URLConnection to send a GET request to HttpCoreNIOListener. The
test case logs show that the transport sends back the status line and the headers, but fails
to write the (empty) body. After 60 seconds it times out and closes the connection, causing
a "Premature EOF" error in URLConnection.
> This seems to be a regression caused by the recent upgrade to httpcore 4.0-beta3.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message