Hi,

2016-07-12 23:27 GMT+03:00 Rossen Stoyanchev <rstoyanc...@pivotal.io>:
>
> hi-
>
> Starting with Tomcat 8.0.35 when an async request times out, in a
> subsequent error dispatch request.isAsyncStarted() returns true.
Previously
> it returned false.
>
> The Servlet spec says:
> If this request has been dispatched using one of the AsyncContext.dispatch
> methods since it was put
> in asynchronous mode, or a call to AsynContext.complete is made, this
> method returns false.

I think the following part of the specification is important:

"
In the event that an asynchronous operation times out, the container must
run through the following steps:
- Invoke the AsyncListener.onTimeout method on all the AsyncListener
instances registered with the ServletRequest on which the asynchronous
operation was initiated.
- If none of the listeners called AsyncContext.complete() or any of the
AsyncContext.dispatch methods, perform an error dispatch with a status code
equal to HttpServletResponse.SC_INTERNAL_SERVER_ERROR.
- If no matching error page was found, or the error page did not call
AsyncContext.complete() or any of the AsyncContext.dispatch methods, the
container MUST call AsyncContext.complete().
"

So isAsyncStarted returns true when in the error page and the error page
should call AsyncContext.complete.

What do you think?

Regards,
Violeta

> No explicit mention of ERROR dispatches but I'd assume once the request
> that called startAsync is done, it won't return true any more. For what
> it's worth Jetty still return false on the ERROR dispatch. Here is a repro
> project [1].
>
> Before creating a ticket I wanted to check if this is expected behavior or
> an unintended side effect of other changes?
>
> Rossen
>
> [1]
>
https://github.com/spring-projects/spring-framework-issues/tree/master/SPR-14444

Reply via email to