Hi, On Mon, Nov 3, 2014 at 1:51 PM, Christoph Läubrich <[email protected]> wrote: > I'm using jetty-8 (embedded) and have a servlet that upon request starts > some (lengthy) computation in the background and wants to return this to the > user after completion. > I try to use the > https://wiki.eclipse.org/Jetty/Feature/Continuations#Suspend_Continue_Pattern > (even though the problem will exits also with suspend/resume). > The problem occurs when I set a timeout (I just want the task to wait a > certian amaount of time for completion and cancel it then): > > If the continuation times out I send an error back to the client (see code > below), but my async task still holds a reference to the continuation. Since > jetty reuses the continuation object after timeout, when the task now > finished and tries to contine the continuation I get problems since > a) The continuation is reused but for a completely different request > b) The continuation is reused but not reasigend yet
When the continuation expires, you should set a flag to your background task to *not* use the continuation, since the response has already been sent. -- Simone Bordet ---- http://cometd.org http://webtide.com http://intalio.com Developer advice, training, services and support from the Jetty & CometD experts. Intalio, the modern way to build business applications. _______________________________________________ jetty-users mailing list [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jetty-users
