Hello,

I recently started working with Servlet 3.0 async stuff with Tomcat 7.0.12,
and I bumped into what may be a serious bug.  Or it may be that I'm just
doing something dumb.  :-)

For some reason, response.sendRedirect and response.sendError are not
producing expected behavior when using an AsyncContext.  The async request
completes normally, and everything looks hunky dory on the server side, but
the client never gets ANY response from the server.  It appears that Tomcat
simply times out after the default 10 seconds and closes the connection.  No
headers are returned, no content, nothing.  I've confirmed with thread dumps
that the server isn't stuck.

Yet...if you use response.setStatus and response.setHeader instead, it works
absolutely fine.  The client gets the response every time.

I put together a very simple test that isolates the issue reliably:
https://github.com/dcheckoway/async-test

See the README in there for details.

Please let me know if I've missed something simple!  I'm relatively new to
Servlet 3.0...

Thanks,
Dan Checkoway

Reply via email to