You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Dmitry Potapov (JIRA)" <ji...@apache.org> on 2014/04/27 16:01:45 UTC

[jira] [Commented] (HTTPCORE-379) HttpAsyncService.exception(...) should shutdown connection on IOException

    [ https://issues.apache.org/jira/browse/HTTPCORE-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13982330#comment-13982330 ] 

Dmitry Potapov commented on HTTPCORE-379:
-----------------------------------------

The exceptions are:
java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
        at sun.nio.ch.IOUtil.write(IOUtil.java:65)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
        at org.apache.http.impl.nio.reactor.SessionOutputBufferImpl.flush(SessionOutputBufferImpl.java:168)
        at org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(DefaultNHttpServerConnection.java:319)
        at org.apache.http.impl.nio.DefaultHttpServerIODispatch.onOutputReady(DefaultHttpServerIODispatch.java:162)
        at org.apache.http.impl.nio.DefaultHttpServerIODispatch.onOutputReady(DefaultHttpServerIODispatch.java:51)
        at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:147)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:181)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:343)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:317)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:589)
        at java.lang.Thread.run(Thread.java:744)

> HttpAsyncService.exception(...) should shutdown connection on IOException
> -------------------------------------------------------------------------
>
>                 Key: HTTPCORE-379
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-379
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.3.2
>            Reporter: Dmitry Potapov
>            Priority: Minor
>         Attachments: NHttpServer.java, shutdown-on-IOException.patch
>
>
> Currently, HttpAsyncService.exception(...) closes connection if response is already submitted. On TCP RST packet received all futher attempts to write into socket will result in IOException, but SelectionKey.readyOps() won't be changed. So, if connection output buffer has some unsent data, BaseIOReactor.writable() will be called again and again, but no data will be written, so reactor thread will stuck.
> I suggest to shutdown connection if IOException occured, this will save from infinite calls to BaseIOReactor.writable()



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org