glassfish
  1. glassfish
  2. GLASSFISH-21005

GlassFish stops responding to http connections if client aborts downloads (grizzly or http service i suppose)

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: grizzly-kernel
    • Labels:
      None
    • Environment:

      CenOs 64 bit, Java 7 u 51

      Description

      To reproduce the issue

      Create a Serlvet that serves a file.

      From a different box, do this a few hundred times.

      HttpURLConnection connection = null;

      URL url = new URL("http://lala:8080/myapp/myfileservingservlet");
      connection = (HttpURLConnection)url.openConnection();

      connection.setDoInput(true);
      connection.setRequestMethod("GET");
      InputStream is = connection.getInputStream();
      connection.getHeaderField("Content-Type);
      connection.disconnect();

      GlassFish logs shows a fair few of these:

      Caused by: java.io.IOException: Connection closed
      at org.glassfish.grizzly.asyncqueue.TaskQueue.onClose(TaskQueue.java:298) ~[nucleus-grizzly-all.jar:na]
      at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.onClose(AbstractNIOAsyncQueueWriter.java:613) ~[nucleus-grizzly-all.jar:na]

      And also a fair few of these

      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:51)
      at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.flushByteBuffer(TCPNIOTransport.java:1252)

      Trying to get anything else from the server shows:

      Caused by: org.apache.http.NoHttpResponseException: The target server failed to respond

      Note that it is easier to reproduce if the request goes over the internet but doesn't happen so frequently if using localhost, no sure about another box in the local network.

      I have also seen the same errors in the logs when launching jws applications via JnlpDownloadServlet. To my undertanding the jws container does a similar thing by requesting the http headers of a jar but then aborting the download if the jar is in the jws cache and hasn't been modified.

      Setting as blocker as it can make the server unusable and there one can not control how http clients interact with the server.

        Activity

        Hide
        oleksiys added a comment -

        Can you please try this patch [1] and check if it's still reproducible?

        Thanks.

        [1] https://dl.dropboxusercontent.com/u/7319744/nucleus-grizzly-all.jar

        Show
        oleksiys added a comment - Can you please try this patch [1] and check if it's still reproducible? Thanks. [1] https://dl.dropboxusercontent.com/u/7319744/nucleus-grizzly-all.jar
        Hide
        pranahata added a comment -

        Olexsys,

        I am quite busy at the moment, the test case is pretty simple. Where you able to reproduce the error without the patch?

        Show
        pranahata added a comment - Olexsys, I am quite busy at the moment, the test case is pretty simple. Where you able to reproduce the error without the patch?

          People

          • Assignee:
            oleksiys
            Reporter:
            pranahata
          • Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: