java.net.SocketException: Broken pipe

Spring JIRA | Prashant Deva | 3 years ago
  1. 0

    Spring 4 websockets causing tons of exceptions

    Stack Overflow | 3 years ago | pdeva
    java.net.SocketException: Broken pipe
  2. 0

    We are using websockets on tomcat 7.0.50 with an in memory simple spring broker. Our logs are littered with this exception {code} 3 ERROR MessageBrokerSockJS-1 handler.XhrStreamingTransportHandler$XhrStreamingSockJsSession:276 - Terminating connection after failure to send message to client. This may be because the client has gone away (see https://java.net/jira/browse/SERVLET_SPEC-44) Feb 15 12:05:16 apmgui i-04e9bc6a: ClientAbortException: java.net.SocketException: Broken pipe Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:371) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:333) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.Response.flushBuffer(Response.java:570) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:307) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.http.server.ServletServerHttpResponse.flush(ServletServerHttpResponse.java:81) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession.writeFrameInternal(StreamingSockJsSession.java:99) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:273) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendHeartbeat(AbstractSockJsSession.java:294) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession$1.run(AbstractSockJsSession.java:309) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.FutureTask.run(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.lang.Thread.run(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: Caused by: java.net.SocketException: Broken pipe Feb 15 12:05:16 apmgui i-04e9bc6a: at java.net.SocketOutputStream.socketWrite0(Native Method) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.net.SocketOutputStream.socketWrite(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.net.SocketOutputStream.write(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:215) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:805) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.coyote.Response.action(Response.java:174) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:366) Feb 15 12:05:16 apmgui i-04e9bc6a: ... 17 more {code} Either: 1. This is a bug in spring, in which case fix it 2. This is expected behavior, in which case provide a workaround/documentation for it so our logs are not littered by it. Either way, this behavior is not documented and presence of this issue makes logs very, very heavy. Not to mention we don't know if this is an actual error in our app or one we can ignore. Either fix this issue or provide an explanation/documentation for it.

    Spring JIRA | 3 years ago | Prashant Deva
    java.net.SocketException: Broken pipe
  3. 0

    We are using websockets on tomcat 7.0.50 with an in memory simple spring broker. Our logs are littered with this exception {code} 3 ERROR MessageBrokerSockJS-1 handler.XhrStreamingTransportHandler$XhrStreamingSockJsSession:276 - Terminating connection after failure to send message to client. This may be because the client has gone away (see https://java.net/jira/browse/SERVLET_SPEC-44) Feb 15 12:05:16 apmgui i-04e9bc6a: ClientAbortException: java.net.SocketException: Broken pipe Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:371) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:333) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.Response.flushBuffer(Response.java:570) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:307) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.http.server.ServletServerHttpResponse.flush(ServletServerHttpResponse.java:81) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession.writeFrameInternal(StreamingSockJsSession.java:99) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:273) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendHeartbeat(AbstractSockJsSession.java:294) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession$1.run(AbstractSockJsSession.java:309) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.FutureTask.run(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.lang.Thread.run(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: Caused by: java.net.SocketException: Broken pipe Feb 15 12:05:16 apmgui i-04e9bc6a: at java.net.SocketOutputStream.socketWrite0(Native Method) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.net.SocketOutputStream.socketWrite(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at java.net.SocketOutputStream.write(Unknown Source) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:215) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:805) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.coyote.Response.action(Response.java:174) Feb 15 12:05:16 apmgui i-04e9bc6a: at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:366) Feb 15 12:05:16 apmgui i-04e9bc6a: ... 17 more {code} Either: 1. This is a bug in spring, in which case fix it 2. This is expected behavior, in which case provide a workaround/documentation for it so our logs are not littered by it. Either way, this behavior is not documented and presence of this issue makes logs very, very heavy. Not to mention we don't know if this is an actual error in our app or one we can ignore. Either fix this issue or provide an explanation/documentation for it.

    Spring JIRA | 3 years ago | Prashant Deva
    java.net.SocketException: Broken pipe
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. linxiaolong 2 times, last 2 months ago
  2. Tahir 23 times, last 2 months ago
  3. linxiaolong 1 times, last 4 months ago
  4. serious2monkeys 7 times, last 1 week ago
  5. kkandda 2 times, last 6 months ago
5 more registered users
85 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.net.SocketException

    Broken pipe

    at java.net.SocketOutputStream.socketWrite0()
  2. Java RT
    SocketOutputStream.write
    1. java.net.SocketOutputStream.socketWrite0(Native Method)
    2. java.net.SocketOutputStream.socketWrite(Unknown Source)
    3. java.net.SocketOutputStream.write(Unknown Source)
    3 frames
  3. Grizzly HTTP
    InternalOutputBuffer.realWriteBytes
    1. org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:215)
    1 frame
  4. Tomcat Util
    ByteChunk.flushBuffer
    1. org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
    1 frame
  5. Grizzly HTTP
    Response.action
    1. org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119)
    2. org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:805)
    3. org.apache.coyote.Response.action(Response.java:174)
    3 frames
  6. Glassfish Core
    ResponseFacade.flushBuffer
    1. org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:366)
    2. org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:333)
    3. org.apache.catalina.connector.Response.flushBuffer(Response.java:570)
    4. org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:307)
    4 frames
  7. Spring
    ServletServerHttpResponse.flush
    1. org.springframework.http.server.ServletServerHttpResponse.flush(ServletServerHttpResponse.java:81)
    1 frame
  8. Spring WebSocket
    AbstractSockJsSession$1.run
    1. org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession.writeFrameInternal(StreamingSockJsSession.java:99)
    2. org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:273)
    3. org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendHeartbeat(AbstractSockJsSession.java:294)
    4. org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession$1.run(AbstractSockJsSession.java:309)
    4 frames
  9. Spring Context
    DelegatingErrorHandlingRunnable.run
    1. org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    1 frame
  10. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    2. java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    3. java.util.concurrent.FutureTask.run(Unknown Source)
    4. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
    5. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    6. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    7. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    8. java.lang.Thread.run(Unknown Source)
    8 frames