Mantis - Resin
|
||||||||||
Viewing Issue Advanced Details | ||||||||||
|
||||||||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: | |||||
5420 | major | always | 04-15-13 18:09 | 05-29-13 10:35 | ||||||
|
||||||||||
Reporter: | bhauer1 | Platform: | ||||||||
Assigned To: | ferg | OS: | ||||||||
Priority: | normal | OS Version: | ||||||||
Status: | closed | Product Version: | 4.0.35 | |||||||
Product Build: | Resolution: | fixed | ||||||||
Projection: | none | |||||||||
ETA: | none | Fixed in Version: | 4.0.37 | |||||||
|
||||||||||
Summary: | 0005420: AsyncContext completed by original synchronous worker thread? | |||||||||
Description: |
It is possible I am doing something wrong, but in Resin 4.0.35, AsyncContexts are being completed immediately when the synchronous worker thread handling a request returns to Resin (after Servlet.service() is done). In other words, it is impossible to work with an AsyncContext once the Servlet's service() method returns, which seems to work against the purpose of AsyncContext. |
|||||||||
Steps To Reproduce: | ||||||||||
Additional Information: |
I am attaching a simple example Servlet that responds immediately and synchronously to /test and responds asynchronously after a 2 second delay to /test?type=async. The asynchronous version calls request.startAsync, attaches an AsyncListener, and submits a Runnable to a ScheduledExecutorService to run after 2 seconds. The AsyncListener will show a call to onComplete() immediately (at the conclusion of the service() method). By the time the ScheduledExecutorService runs the Runnable, the AsyncContext has been closed and the Runnable freezes up. If you print a Throwable in the listener's onComplete method, the following stack trace is visible: at com.caucho.server.http.AsyncListenerNode.onComplete(AsyncListenerNode.java:83) at com.caucho.server.http.AsyncContextImpl.onComplete(AsyncContextImpl.java:379) at com.caucho.server.http.HttpServletRequestImpl.finishRequest(HttpServletRequestImpl.java:1696) at com.caucho.server.http.AbstractHttpRequest.finishRequest(AbstractHttpRequest.java:1848) at com.caucho.server.hmux.HmuxRequest.handleRequestImpl(HmuxRequest.java:385) ... Shouldn't the request remain alive until the AsyncContext.complete() method is called? |
|||||||||
Relationships |
| |||||||||
Attached Files: | AsyncTest.java [^] (2,733 bytes) 04-15-13 18:09 |
Notes | |||||
|
|||||
|
|