Hello,

I am working with Apache's HTTP async client and have encountered a possible 
bug (race condition).

PROBLEM:
While  accessing a nonexistent file on the server, I would ALWAYS expect to 
receive a "404 : component not found" error message.
However, the behavior is sporadic. Sometimes I receive the correct message, 
whereas, on the other occasions it throw the following exception:

org.apache.http.impl.nio.client.LoggingAsyncRequestExecutor exception
SEVERE: http-outgoing-1 [ACTIVE] HTTP protocol exception: An established 
connection was aborted by the software in your host machine
java.io.IOException: An established connection was aborted by the software in 
your host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:225)
at sun.nio.ch.IOUtil.read(IOUtil.java:198)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:359)
at 
org.apache.http.impl.nio.reactor.SessionInputBufferImpl.fill(SessionInputBufferImpl.java:97)
at 
org.apache.http.impl.nio.codecs.AbstractMessageParser.fillBuffer(AbstractMessageParser.java:115)
at 
org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:167)
at 
org.apache.http.impl.nio.DefaultHttpClientIODispatch.onInputReady(DefaultHttpClientIODispatch.java:125)
at 
org.apache.http.impl.nio.DefaultHttpClientIODispatch.onInputReady(DefaultHttpClientIODispatch.java:50)
at 
org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:112)
at 
org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160)
at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342)
at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320)
at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280)
at 
org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106)
at 
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:604)
at java.lang.Thread.run(Thread.java:722)

java.io.IOException: An established connection was aborted by the software in 
your host machine

INVESTIGATION:
I downloaded the source code and tried to investigate it myself. Interestingly, 
I found that the "IOReactorStatus" is set to "SHUTDOWN_REQUEST" only after the 
exception has already been thrown.
I am not sure if this is the root cause or not, but I would highly appreciate 
if somebody could please confirm if it's a known issue and if there exists a 
solution.

Thanks,
Poonam

Reply via email to