java.io.IOException: Broken pipe

GitHub | equake | 5 months ago
  1. 0

    Remote Collection isn't working?

    GitHub | 5 months ago | equake
    java.io.IOException: Broken pipe
  2. 0

    GitHub comment 1216#157919836

    GitHub | 1 year ago | wenerme
    java.io.IOException: Broken pipe
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    We are using Server-Sent Events to allow our client application to listen to events raised by our Jersey server. This works great. We have a requirement for our server to have an accurate list of currently-connected SSE callers (instances of our client application). To this end, our server sends a tiny message to each client (via eventOutput.write) once every five seconds. If our client is shut down while SSE-connected, or if the remote computer is powered off while SSE-connected, our server's eventOutput.write call correctly throws the ClientAbortException/SocketException exception shown below. That's perfect: we catch the exception, and mark that client as no longer connected. The problem: there are two cases where calling eventOutput.write to a no-longer-connected computer does NOT throw an exception: 1) if the Ethernet cable of the remote computer is disconnected while the client is SSE-connected, and 2) if the network adapter in the remote computer is turned off (e.g., by an administrator) while the client is SSE-connected. In these two cases, eventOutput.write does not throw an exception. We can call eventOutput.write to the remote computer every five seconds for hours and no exception is thrown. This makes it impossible to detect that the remote computer is no longer connected. To sum up, there are four cases: 1) Client software is shut down: eventOutput.write() correctly throws an exception. 2) Computer running client software is powered down: eventOutput.write() correctly throws an exception. 3) Etherhet cable is disconnected from computer running client software: eventOutput.write does not detect broken connection. 4) Network adapter on computer running client software is turned off: eventOutput.write does not detect broken connection. Here is the (good/useful) exception we get in cases where eventOutput.write DOES throw the exception we want: {code} org.apache.catalina.connector.ClientAbortException: null at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:371) ~[catalina.jar:7.0.53] at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:333) ~[catalina.jar:7.0.53] at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:101) ~[catalina.jar:7.0.53] at org.glassfish.jersey.servlet.internal.ResponseWriter$NonCloseableOutputStreamWrapper.flush(ResponseWriter.java:303) ~[jaxrs-ri-2.13.jar:2.13.] at org.glassfish.jersey.message.internal.CommittingOutputStream.flush(CommittingOutputStream.java:292) ~[jaxrs-ri-2.13.jar:2.13.] at org.glassfish.jersey.server.ChunkedOutput$1.call(ChunkedOutput.java:240) ~[jaxrs-ri-2.13.jar:2.13.] at org.glassfish.jersey.server.ChunkedOutput$1.call(ChunkedOutput.java:190) ~[jaxrs-ri-2.13.jar:2.13.] at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jaxrs-ri-2.13.jar:2.13.] at org.glassfish.jersey.internal.Errors.process(Errors.java:242) ~[jaxrs-ri-2.13.jar:2.13.] at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:347) ~[jaxrs-ri-2.13.jar:2.13.] at org.glassfish.jersey.server.ChunkedOutput.flushQueue(ChunkedOutput.java:190) ~[jaxrs-ri-2.13.jar:2.13.] at org.glassfish.jersey.server.ChunkedOutput.write(ChunkedOutput.java:180) ~[jaxrs-ri-2.13.jar:2.13.] at com.appserver.webservice.AgentSsePollingManager$ConnectionChecker.run(AgentSsePollingManager.java:174) ~[AgentSsePollingManager$ConnectionChecker.class:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_71] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) [na:1.7.0_71] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_71] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.7.0_71] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71] Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.7.0_71] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) ~[na:1.7.0_71] at java.net.SocketOutputStream.write(SocketOutputStream.java:159) ~[na:1.7.0_71] at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:215) ~[tomcat-coyote.jar:7.0.53] at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480) ~[tomcat-coyote.jar:7.0.53] at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119) ~[tomcat-coyote.jar:7.0.53] at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:799) ~[tomcat-coyote.jar:7.0.53] at org.apache.coyote.Response.action(Response.java:174) ~[tomcat-coyote.jar:7.0.53] at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:366) ~[catalina.jar:7.0.53] ... 19 common frames omitted {code}

    Java.net JIRA | 2 years ago | ricb
    org.eclipse.jetty.io.EofException

  1. MoYapro 7 times, last 3 weeks ago
  2. DoktorDoener666 5 times, last 4 weeks ago
  3. tvrmsmith 1 times, last 1 month ago
  4. dafman 1 times, last 2 months ago
  5. davidvanlaatum 2 times, last 3 months ago
21 more registered users
74 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.IOException

    Broken pipe

    at sun.nio.ch.FileDispatcherImpl.writev0()
  2. Java RT
    SocketChannelImpl.write
    1. sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
    2. sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)
    3. sun.nio.ch.IOUtil.write(IOUtil.java:148)
    4. sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504)
    4 frames
  3. org.glowroot.agent
    SingleThreadEventExecutor$5.run
    1. org.glowroot.agent.shaded.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:305)
    2. org.glowroot.agent.shaded.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:859)
    3. org.glowroot.agent.shaded.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:375)
    4. org.glowroot.agent.shaded.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:826)
    5. org.glowroot.agent.shaded.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1436)
    6. org.glowroot.agent.shaded.netty.channel.ChannelHandlerInvokerUtil.invokeFlushNow(ChannelHandlerInvokerUtil.java:165)
    7. org.glowroot.agent.shaded.netty.channel.DefaultChannelHandlerInvoker.invokeFlush(DefaultChannelHandlerInvoker.java:381)
    8. org.glowroot.agent.shaded.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:395)
    9. org.glowroot.agent.shaded.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:259)
    10. org.glowroot.agent.shaded.netty.handler.codec.http2.Http2ConnectionHandler.flush(Http2ConnectionHandler.java:161)
    11. org.glowroot.agent.shaded.netty.channel.ChannelHandlerInvokerUtil.invokeFlushNow(ChannelHandlerInvokerUtil.java:165)
    12. org.glowroot.agent.shaded.netty.channel.DefaultChannelHandlerInvoker.invokeFlush(DefaultChannelHandlerInvoker.java:381)
    13. org.glowroot.agent.shaded.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:395)
    14. org.glowroot.agent.shaded.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:259)
    15. org.glowroot.agent.shaded.netty.channel.DefaultChannelPipeline.flush(DefaultChannelPipeline.java:1129)
    16. org.glowroot.agent.shaded.netty.channel.AbstractChannel.flush(AbstractChannel.java:234)
    17. org.glowroot.agent.shaded.grpc.netty.WriteQueue.flush(WriteQueue.java:131)
    18. org.glowroot.agent.shaded.grpc.netty.WriteQueue.access$000(WriteQueue.java:48)
    19. org.glowroot.agent.shaded.grpc.netty.WriteQueue$1.run(WriteQueue.java:58)
    20. org.glowroot.agent.shaded.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:339)
    21. org.glowroot.agent.shaded.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:373)
    22. org.glowroot.agent.shaded.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
    22 frames
  4. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    2 frames