On 02/06/2017 10:46, Violeta Georgieva wrote: > 2017-06-02 12:37 GMT+03:00 Mark Thomas <ma...@apache.org>: >> >> On 02/06/2017 10:23, Violeta Georgieva wrote: >>> Hi Mark, >>> >>> 2017-05-22 14:28 GMT+03:00 Mark Thomas <ma...@apache.org>: >> >> <snip/> >> >>>> I'm leaning towards thinking this is an application bug. >>>> >>>> If the application has two non-container threads, A and B, then, as per >>>> section 2.3.3.4 of the Servlet spec, the application is responsible for >>>> accessing the request from those threads in a thread-safe manner. >>> >>> Yep I agree with the above, but in this scenario we have one > non-container >>> thread A >>> and the other thread B is actually a container thread that tries to > send a >>> notification for an error. >>> >>> org.apache.catalina.connector.CoyoteAdapter.asyncDispatch Exception > while >>> processing an asynchronous request >>> java.lang.IllegalStateException: Calling [asyncError()] is not valid > for a >>> request with Async state [DISPATCHING] >>> at org.apache.coyote.AsyncStateMachine.asyncError( >>> AsyncStateMachine.java:398) >>> at > org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:393) >>> at org.apache.coyote.Request.action(Request.java:390) >>> at org.apache.catalina.core.AsyncContextImpl.setErrorState( >>> AsyncContextImpl.java:385) >>> at org.apache.catalina.connector.CoyoteAdapter.asyncDispatch( >>> CoyoteAdapter.java:175) >>> at > org.apache.coyote.AbstractProcessor.dispatch(AbstractProcessor.java:225) >>> at org.apache.coyote.AbstractProcessorLight.process( >>> AbstractProcessorLight.java:53) >>> >>> What do you think? >> >> I think I still need more clarity on what is going on. Going back to >> your original e-mail, the problems start when: >> >> - At some point thread A makes dispatch() -> Async state is changed >> to DISPATCHING >> - At the same time a socket error occurs > > Client closes the connection while the application is writing the response.
Sorry - still trying to clarify in my mind what is going on here. Is this right? Application does async write (that does not complete). Container will complete this later. Application calls dispatch. At the same time the application calls dispatch, the container tries to complete the async write and that fails because the client disconnected? Error handling then fails because of the dispatch? Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org