3 Replies Latest reply on Sep 10, 2007 2:21 PM by 666705

    SocketException: Broken pipe

    666705
      Hello,

      We find the following broken pipe socket exception occurring in our logs:
      java.net.SocketException: Write
      failed: Broken pipe
      at jrockit.net.SocketNativeIO.writeBytesPinned(null:-2)
      at jrockit.net.SocketNativeIO.socketWrite(null:-1)
      at java.net.SocketOutputStream.socketWrite0(SocketOutputStream.java:-1)
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
      at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
      at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:525)
      at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:504)
      at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
      at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:469)
      at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:304)
      at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:133)
      at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:168)
      at weblogic.servlet.internal.WLOutputStreamWriter.writeBytes(WLOutputStreamWriter.java:168)
      at weblogic.servlet.internal.WLOutputStreamWriter.flushBuffer(WLOutputStreamWriter.java:212)
      at weblogic.servlet.internal.WLOutputStreamWriter.write(WLOutputStreamWriter.java:132)
      at weblogic.servlet.internal.WLOutputStreamWriter.write(WLOutputStreamWriter.java:113)
      at weblogic.servlet.internal.DelegateChunkWriter.print(DelegateChunkWriter.java:118)
      at weblogic.servlet.internal.ChunkOutputWrapper.print(ChunkOutputWrapper.java:146)
      at weblogic.servlet.jsp.JspWriterImpl.print(JspWriterImpl.java:151)
      at custom.web.tags.i18n.Text.doEndTag(Text.java:419)

      This exception occurs while our custom tag is writing its output. Any ideas of what could be causing the broken pipe?

      Thanks
        • 1. Re: SocketException: Broken pipe
          666705
          These broke pipe exceptions happen when the client (browser) has closed the connection, but the server (your tag) continues to try to write to the stream.

          This usually happens when someone clicks Back, Stop, etc. in the browser and it disconnects from the server before the request is finished. Sometimes, it can happen because, for example, the Content-Length header is incorrect (and the browser takes its value as true).

          Usually, this is a non-event, and nothing to worry about. But if you are seeing them in your dev environment when you know you have not interrupted your browser, you might dig a bit more to find out why.

          WLS server will try to filter these exceptions from the web container out of the log, since it is due to client (browser) action and we can't do anything about it. But the server doesn't catch all of them.
          • 2. Re: SocketException: Broken pipe
            666705
            Thanks for the response.

            I initially thought this exception was caused by clicking Back, Stop, etc. However, I found that by doing a browser interrupt, I actually get a "connection aborted by peer" exception and not the "broken pipe":

            java.net.SocketException: socket write
            error: Connection aborted by peer
            at jrockit.net.SocketNativeIO.writeBytesPinned(null:-2)
            at jrockit.net.SocketNativeIO.socketWrite(null:-1)
            at java.net.SocketOutputStream.socketWrite0(SocketOutputStream.java:-1)
            at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
            at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
            at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:525)
            at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:504)
            at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
            at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:469)
            at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:304)
            at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:133)
            at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:168)
            at weblogic.servlet.internal.WLOutputStreamWriter.writeBytes(WLOutputStreamWriter.java:168)
            at weblogic.servlet.internal.WLOutputStreamWriter.flushBuffer(WLOutputStreamWriter.java:212)
            at weblogic.servlet.internal.WLOutputStreamWriter.write(WLOutputStreamWriter.java:132)
            at weblogic.servlet.internal.WLOutputStreamWriter.write(WLOutputStreamWriter.java:113)
            at weblogic.servlet.internal.DelegateChunkWriter.print(DelegateChunkWriter.java:118)
            at weblogic.servlet.internal.ChunkOutputWrapper.print(ChunkOutputWrapper.java:146)
            at weblogic.servlet.jsp.JspWriterImpl.print(JspWriterImpl.java:151)
            at custom.web.tags.i18n.Text.doEndTag(Text.java:419)

            This leads me to believe that the Broken pipe is caused by something else.
            • 3. Re: SocketException: Broken pipe
              666705
              Hi Nick,

              That infact is correct, as far as my understanding, the broken pipe exception occurs when the connection is closed by the client, yet the writing to the stream doesn't stop.

              I am looking into this issue, and will get back to you on this with something concrete soon.

              Arunabha Mukhopadhyay