hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HTTPCORE-272) AsyncNHttpServiceHandler does not react when long polling clients disconnect
Date Tue, 13 Sep 2011 12:59:09 GMT

     [ https://issues.apache.org/jira/browse/HTTPCORE-272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCORE-272.
----------------------------------------

    Resolution: Fixed

Geir,

Protocol API in HttpCore has undergone a thorough redesign. The old API and implementation
classes had been deprecated and new implementations added to supersede deprecated ones. The
good news is the new API provides a facility to cancel long running asynchronous request handlers.
The new async request handler can optionally return a Cancellable instance from the #handle
method [1]. This enables the protocol handler to cancel the request handling process if the
handler is no longer expected to produce a result, for instance, due to the opposite endpoint
closing the connection. 

Please have a look at the new API and let me know if it addresses the issue for you. Feedback
will be highly appreciated.

Oleg

[1] http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestHandler.java

> AsyncNHttpServiceHandler does not react when long polling clients disconnect
> ----------------------------------------------------------------------------
>
>                 Key: HTTPCORE-272
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-272
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.1.3
>            Reporter: Geir Harald Hansen
>            Priority: Minor
>             Fix For: 4.2-alpha2
>
>
> When using NHttpRequestHandler and in its handle() method storing the NHttpResponseTrigger
and HttpResponse for later, to implement long polling, AsyncNHttpServiceHandler does not react
when clients disconnect. It does react (its close() method is invoked) if other connections
are closed, though. Its close() method is also called later when trying to write to the connection.
> Order of events:
> 1. NHttpRequestHandler.handle() invoked, trigger and response stored
> 2. Client disconnects - connection goes to CLOSE_WAIT
> 3. Connection goes out of CLOSE_WAIT and disappears
> 4. After a few minutes I try to use the NHttpResponseTrigger to send a response
> 5. Now AsyncNHttpServiceHandler reacts and tells me the connection has closed
> It would be useful if AsyncNHttpServiceHandler was told of closed connections immediately
so resources are not wasted preparing data for clients that are no longer there.

--
This message is automatically generated by JIRA.
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


Mime
View raw message