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

Asankha C. Perera commented on SYNAPSE-341:
-------------------------------------------

Maybe Oleg can comment on whether an origin server can prematurely respond to 
an http request, before the full request was read. 

I found the following from the RFC 2616 Section 8.2.3

      - If an origin server receives a request that does not include an
        Expect request-header field with the "100-continue" expectation,
        the request includes a request body, and the server responds
        with a final status code before reading the entire request body
        from the transport connection, then the server SHOULD NOT close
        the transport connection until it has read the entire request,
        or until the client closes the connection. Otherwise, the client
        might not reliably receive the response message. However, this
        requirement is not be construed as preventing a server from
        defending itself against denial-of-service attacks, or from
        badly broken client implementations.

Same section also mentions:
     - Upon receiving a request which includes an Expect request-header
        field with the "100-continue" expectation, an origin server MUST
        either respond with 100 (Continue) status and continue to read
        from the input stream, or respond with a final status code. The
        origin server MUST NOT wait for the request body before sending
        the 100 (Continue) response. If it responds with a final status
        code, it MAY close the transport connection or it MAY continue
        to read and discard the rest of the request.  It MUST NOT
        perform the requested method if it returns a final status code.

> System unstable when HTTP response returned before request fully written
> ------------------------------------------------------------------------
>
>                 Key: SYNAPSE-341
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-341
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2-beta1
>         Environment: All environments
>            Reporter: Jake Lambert
>            Assignee: Asankha C. Perera
>            Priority: Critical
>             Fix For: 1.3
>
>         Attachments: ClientSideReqResp.txt
>
>
> When using a proxy service and HTTP-NIO the following error is repeatedly 
> generated when a remote WS returns its response before the request is fully 
> written (i.e. when AXIOM is being used by the target service to parse the 
> request XML and the request includes unprocessed attachment(s) or a fault 
> occurs before fully reading the request):
> I/O dispatcher 12: System may be unstable: IOReactor encountered a runtime 
> exception : null
> java.lang.NullPointerException
>       at 
> org.apache.synapse.transport.nhttp.ClientHandler.outputReady(ClientHandler.java:353)
>       at 
> org.apache.http.impl.nio.DefaultNHttpClientConnection.produceOutput(DefaultNHttpClientConnection.java:170)
>       at 
> org.apache.http.impl.nio.DefaultClientIOEventDispatch.outputReady(DefaultClientIOEventDispatch.java:105)
>       at 
> org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:114)
>       at 
> org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:198)
>       at 
> org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:180)
>       at 
> org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:142)
>       at 
> org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:70)
>       at 
> org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:318)
>       at java.lang.Thread.run(Unknown Source)
> The actual cause is the ConnectionPool 'cleanConnectionReferences()' method, 
> which clears the REQUEST_SOURCE_BUFFER upon completion of the response HTTP 
> decoding, rather than on completion of both the request AND response 
> processing.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to