Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-Alpha3
-
Fix Version/s: 2.0-Beta
-
Component/s: Push Library
-
Labels:None
-
Environment:Apache Tomcat 7, ICEpush
Description
Servlet 3.0's AsyncContext uses a timeout mechanism for pending requests. The default timeout is dependent on the container. However, this timeout can potentially interfere with ICEpush' heartbeat mechanism. When a pending request gets timed out by Servlet 3.0 before the next ping comes in the following Exception can be experienced:
Caused by: java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.apache.catalina.core.AsyncContextImpl.check(AsyncContextImpl.java:436)
at org.apache.catalina.core.AsyncContextImpl.complete(AsyncContextImpl.java:87)
at org.icepush.servlet.AsyncAdaptingServlet$AsyncRequestResponse.respondWith(AsyncAdaptingServlet.java:66)
at org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:131)
... 38 more
Caused by: java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.apache.catalina.core.AsyncContextImpl.check(AsyncContextImpl.java:436)
at org.apache.catalina.core.AsyncContextImpl.complete(AsyncContextImpl.java:87)
at org.icepush.servlet.AsyncAdaptingServlet$AsyncRequestResponse.respondWith(AsyncAdaptingServlet.java:66)
at org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:131)
... 38 more
Issue Links
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
The AsyncAdaptingServlet now takes a Configuration in its constructor as well. The configuration is used to get the heartbeatTimeout from the web.xml using 15000 as the default value as used elsewhere in the ICEpush code. The heartbeatTimeout value is used to set the timeout on the AsyncContext on a per-request basis, by multiplying the heartbeatTimeout by 2.
Marking this one as FIXED.