Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Is it possible to tell if a continuation request had been cancelled?

Hi,

On Tue, Nov 8, 2011 at 17:26, Matthew Painter
<matthew.painter@xxxxxxxxxx> wrote:
> Sorry, let me outline a better example :)
> Say that a user requests a page in a browser that is serviced by a servlet
> that uses jetty continuations. This servlet kicks off some long running HTTP
> request to another API (say 1 minute), and suspends the request. When this
> HTTP request is finished, the data from the proxied request is processed,
> and the continuation resumed, and data passed back to the user.
> This is all good. But what if the original HTTP request is cancelled by the
> user in the browser? Can we detect this, complete the continuation, and
> cancel the proxied HTTP request somehow?

No. When the user e.g. closes the browser, the connection is closed,
but the server does not currently detect this when a request is
suspended and the connector is the SelectChannelConnector (which is
Jetty's default).
When the proxied request returns, Jetty will try to write the
response, find a closed connection, and close the server-side end of
that connection.

Simon
-- 
http://cometd.org
http://intalio.com
http://bordet.blogspot.com
----
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz


Back to the top