Created attachment 25667 [details] Servlet 3.0 isAsyncStarted testcase In the attached example, an async request is created, but within a Runnable started using AsyncContext.start() the isAsyncStarted() returns false. This conflicts with the servlet 3.0 specification. Quoting chapter "2.3.3.3 Asynchronous processing" : " public boolean isAsyncStarted() - Returns true if async processing has started on this request, and false otherwise. 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. " This output is generated by Tomcat 7.0.0: Start async() Dispatching start() request.isAsyncStarted()1true Returning from doGet() request.isAsyncStarted()2false Before sleep() After sleep() request.isAsyncStarted()3false Returning from run() request.isAsyncStarted()4false The following output is what we would expect and what Jetty v8.0 generates: Start async() Dispatching start() request.isAsyncStarted()1true Returning from doGet() request.isAsyncStarted()2true Before sleep() After sleep() request.isAsyncStarted()3true Returning from run() request.isAsyncStarted()4false
Please could you confirm that the test case is provided under the terms of section 5 of the Apache License, v2 and that you have the right to provide this code under those terms. The header in the test case seems to suggest otherwise.
Check Revision 960283 and review my test case TestAsyncContextImpl. Fix is proposed at tomcat 7.0.1 Many thanks to report this bug. Peter
The fix breaks the Servlet TCK and therefore will have to be reverted.
I have reverted the original fix and applied a new fix that fixes the issue described here and still passes the Servlet TCK.
(In reply to comment #1) > Please could you confirm that the test case is provided under the terms of > section 5 of the Apache License, v2 and that you have the right to provide this > code under those terms. The header in the test case seems to suggest otherwise. Yes, that's fine.
(In reply to comment #4) > I have reverted the original fix and applied a new fix that fixes the issue > described here and still passes the Servlet TCK. Thanks for the quick fix! I'll give it a try.
(In reply to comment #6) > (In reply to comment #4) > > I have reverted the original fix and applied a new fix that fixes the issue > > described here and still passes the Servlet TCK. > > Thanks for the quick fix! I'll give it a try. Dear All, when I run the test case on the latest version of the tomcat trunk, I get the following output, which looks like the Runnable we try to start is never executed: Start async() Dispatching start() request.isAsyncStarted()1true Returning from doGet()
Yep. The test only looked at the correctness of the return values present, it didn't check all the expected return values were present. I have fixed the test case and am looking at the additional changes required now. Should be quite quick.
Sorry about that. Fixed in trunk. Will be in 7.0.1 onwards.
(In reply to comment #9) > Sorry about that. Fixed in trunk. Will be in 7.0.1 onwards. Thanks a lot for the quick response! I'll retest from the trunk tomorrow morning.
(In reply to comment #10) > (In reply to comment #9) > > Sorry about that. Fixed in trunk. Will be in 7.0.1 onwards. > > Thanks a lot for the quick response! > I'll retest from the trunk tomorrow morning. this problem appears to be fixed, thanks a lot! However, I ran into another problem, which I reported as new bug (49567).