-
Bug
-
Resolution: Done
-
Major
-
1.4.2.Final
-
None
-
None
Continuing on from UNDERTOW-776, I think I've narrowed down the race condition that is triggering this.
09:33:01,420 [XNIO-1 I/O-7] ERROR io.undertow.request - UT005071: Undertow request failed HttpServerExchange{ POST /foo request {Connection=[Keep-Alive], Content-Length=[25817], Content-Type=[application/x-www-form-urlencoded; charset=UTF-8], User-Agent=[Apache-HttpAsyncClient/4.0.2 (java 1.5)], Host=[my-host:80]} response {}} java.lang.IllegalStateException: UT000146: HttpServerExchange cannot have both async IO resumed and dispatch() called in the same cycle at io.undertow.server.HttpServerExchange.dispatch(HttpServerExchange.java:783) at io.undertow.server.HttpServerExchange.dispatch(HttpServerExchange.java:761) at MyCode.handleRequest at io.undertow.server.Connectors.executeRootHandler(Connectors.java:207) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805) at io.undertow.util.SameThreadExecutor.execute(SameThreadExecutor.java:35) at io.undertow.server.HttpServerExchange.dispatch(HttpServerExchange.java:790) at io.undertow.server.HttpServerExchange.dispatch(HttpServerExchange.java:808) at io.undertow.server.handlers.form.FormEncodedDataDefinition$FormEncodedDataParser.handleEvent(FormEncodedDataDefinition.java:117) at io.undertow.server.handlers.form.FormEncodedDataDefinition$FormEncodedDataParser.handleEvent(FormEncodedDataDefinition.java:90) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at io.undertow.channels.DetachableStreamSourceChannel$SetterDelegatingListener.handleEvent(DetachableStreamSourceChannel.java:231) at io.undertow.channels.DetachableStreamSourceChannel$SetterDelegatingListener.handleEvent(DetachableStreamSourceChannel.java:218) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88) at org.xnio.nio.NioHandle$1.run(NioHandle.java:50) at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:580) at org.xnio.nio.WorkerThread.run(WorkerThread.java:464) 09:33:01,420 [XNIO-1 task-4] ERROR io.undertow.request - UT005080: HttpServerExchange cannot have both async IO resumed and dispatch() called in the same cycle
It smells as if there is a race condition in resuming the reads on a channel and clearing the flag that says that it has been dispatched.