Anonymous | Login | Signup for a new account | 12-17-2024 08:25 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0005420 | [Resin] | major | always | 04-15-13 18:09 | 05-29-13 10:35 | ||||
Reporter | bhauer1 | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 4.0.35 | ||||||
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. |
||||||||
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? |
||||||||
Attached Files | AsyncTest.java [^] (2,733 bytes) 04-15-13 18:09 | ||||||||
|
Notes | |
(0006267) ferg 05-29-13 10:35 |
server/1ld7 Note: this issue is specific to Hmux, i.e. Resin behind a load balancer. |
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
35 total queries executed. 29 unique queries executed. |