https://bz.apache.org/bugzilla/show_bug.cgi?id=60718

--- Comment #4 from Remy Maucherat <r...@apache.org> ---
I think it's not going to "work" unless AsyncContextImpl.fireOnComplete calls
context.fireRequestDestroyEvent(request). Or something like that.

The Tomcat code is based on the thinking that the request remains "in scope"
while the async is started (so even when the Servlet's service method is no
longer executed), which is what the spec seems to say (section 3.12).

Although it seems to contradict section 3.12 of the spec, it could be
interpreted wrong in Tomcat and requestInitialized and requestDestroyed should
simply be called around the Servlet's service method call. Right now, the code
is very careful to not call requestDestroyed if async is started, and then it's
obvious there are cases where it's not going to be called. And doing it like
that is a duplicate for what AsyncListener does so that's rather weird, but
maybe it's better for some frameworks (?). I would remove !request.isAsync() in
StandardHostValve, and drop fireRequestDestroyEvent from async dispatch.

So there is likely two possibilities, but Tomcat currently does neither.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to