[ 
https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186215#comment-13186215
 ] 

Oleg Kalnichevski commented on HTTPCORE-289:
--------------------------------------------

The problem stems from how HttpAsyncService handles pipelined (out of sequence) 
request messages. Essentially, once a request message has been received the 
protocol handler stops reacting to input events until a response is generated 
and fully written out. So, if you open a connection with telnet and do 
something like that
---
GET / HTTP/1.1

GET / HTTP/1.1

----
all at once, HttpAsyncService will correctly generate two response messages 
regardless how long it takes to generate each message. The side-effect of this 
approach is that HttpAsyncService cannot detect and react to the opposite end 
causing the connection to go to a half-closed state while waiting for a 
response to get submitted.

Oleg
                
> Cancellable#cancel() not invoked when network connection dies
> -------------------------------------------------------------
>
>                 Key: HTTPCORE-289
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-289
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.2-alpha2
>            Reporter: Geir Harald Hansen
>             Fix For: 4.2-alpha3
>
>         Attachments: Test.java
>
>
> I am rewriting my software to use the new API that comes with 4.2-alpha2. 
> Returning a Cancellable from HttpAsyncRequestHandler#handle() seems like a 
> good idea for long running requests like long polling. But I don't ever see 
> Cancellable#cancel() being called.
> I telnet into my server and type the necessary HTTP to start a long running 
> request. A Cancellable is created and returned from handle(). Then I kill the 
> telnet process, thereby killing the connection. I expect cancel() to be 
> invoked in the connection's Cancellable at this point, but nothing happens. 
> cancel() is not invoked in my Cancellable, and there are no calls to 
> HttpAsyncServiceHandler#closed(), HttpAsyncServiceHandler#exception() or 
> DefaultServerIODispatch#onClosed() either.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to