You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Geir Harald Hansen (Created) (JIRA)" <ji...@apache.org> on 2012/01/08 17:29:39 UTC

[jira] [Created] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

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


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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Resolved] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Oleg Kalnichevski (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCORE-289.
----------------------------------------

    Resolution: Fixed

I have found what appears to be a reasonable solution to the problem. Please re-test with the latest SVN snapshot.

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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Resolved] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Oleg Kalnichevski (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCORE-289.
----------------------------------------

    Resolution: Fixed

I fixed the regression in SVN trunk and also added a test case for such a scenario. Please review and re-test. Also feel free to contribute more test cases if you can think of other ways of stressing the protocol handler.

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-beta1
>            Reporter: Geir Harald Hansen
>         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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Oleg Kalnichevski (Commented) (JIRA)" <ji...@apache.org>.
    [ 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Geir Harald Hansen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184416#comment-13184416 ] 

Geir Harald Hansen commented on HTTPCORE-289:
---------------------------------------------

I tried with the latest version from subversion, but still had no luck. So I write a minimal example to show the problem I'm having.

With the attached Test.java I run it, telnet into it and type "GET / HTTP/1.0" followed by an empty line. The program now prints "Postponing response..." to the console. Now if I kill the telnet process nothing happens. After 30 seconds there is a timeout and the program prints "Cancelled!" to the console.

What I expected was to get "Cancelled!" immediately when I kill the telnet process, dropping the connection to the program.

                
> 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
>         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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Oleg Kalnichevski (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCORE-289:
---------------------------------------

    Fix Version/s: 4.2-alpha3

I have a theory why this is happening. Unfortunately if proven correct it may mean there is no easy / elegant solution to the problem.

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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Geir Harald Hansen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188007#comment-13188007 ] 

Geir Harald Hansen commented on HTTPCORE-289:
---------------------------------------------

I re-tested with the latest SVN snapshot. There's now a cancel immediately when I kill the connection. Thanks!

Looking forward to the 4.2 release :)

                
> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Oleg Kalnichevski (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCORE-289:
---------------------------------------

    Fix Version/s: 4.2-beta2
    
> 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-beta1
>            Reporter: Geir Harald Hansen
>             Fix For: 4.2-beta2
>
>         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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Geir Harald Hansen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Geir Harald Hansen updated HTTPCORE-289:
----------------------------------------

    Affects Version/s:     (was: 4.2-alpha2)
                       4.2-beta1
    
> 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-beta1
>            Reporter: Geir Harald Hansen
>         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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Oleg Kalnichevski (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182260#comment-13182260 ] 

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

That sounds bizarre. Are you sure IOEventDispatch#disconnected() never gets fired? If it does not, naturally HttpAsyncServiceHandler#closed() never gets called as well and the Cancellable cannot be canceled.

By the way, there has been a number of API changes in SVN trunk which will soon be released as 4.2-BETA-1. Please consider upgrading to the latest SVN snapshot and porting your application to the latest API. As of this point the 4.2 API is not expected to change (unless some major design flaws are discovered).

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
>
> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Geir Harald Hansen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Geir Harald Hansen updated HTTPCORE-289:
----------------------------------------

    Fix Version/s:     (was: 4.2-beta1)
    
> 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-beta1
>            Reporter: Geir Harald Hansen
>         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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Geir Harald Hansen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Geir Harald Hansen updated HTTPCORE-289:
----------------------------------------

    Attachment: Test.java

Example to show Cancellable not cancelled when you kill the connection from the outside (e.g. on Linux, killing telnet process with kill command)
                
> 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
>         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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Reopened] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Geir Harald Hansen (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Geir Harald Hansen reopened HTTPCORE-289:
-----------------------------------------


4.2-beta1 downloaded from the website fails with the attached Test.java code. I'm pretty sure this was working with an SVN snapshot at one point.

Do an HTTP request (with telnet, GET, or similar) and kill the process. The cancel() method is still not invoked until the timeout.

                
> 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-beta1
>
>         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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCORE-289) Cancellable#cancel() not invoked when network connection dies

Posted by "Geir Harald Hansen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182294#comment-13182294 ] 

Geir Harald Hansen commented on HTTPCORE-289:
---------------------------------------------

IOEventDispatch#disconnected() doesn't get fired when the connection is lost. Only if I eventually try to send a response, which fails because the connection is long gone.

I will try the latest SVN snapshot and see if I can come up with a minimal example.

                
> 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
>
> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org