Jetty
  1. Jetty
  2. JETTY-150

Using the size of the buffer as identifier?

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 6.0.1
    • Fix Version/s: None
    • Component/s: HTTP
    • Labels:
      None
    • Number of attachments :
      0

      Description

      It all started when I encountered spurious exceptions like the ones at the end of the message. Then I browsed a little through the code referenced in the stacktraces, and found the following implementation of AbstractConnector.getBuffer():

      public Buffer getBuffer(int size)

      { if (size==_headerBufferSize) ... else if (size==_responseBufferSize) ... else if (size==_requestBufferSize) ... }

      Well, the implementation uses the size of the buffer as an identified, which is quite an assumption. Things can get messed up if two buffers have the same size which happened to be my case. To verify this, I made sure the buffers have different values and the exceptions went away.

      Here are the exceptions mentioned above:

      java.io.IOException: FULL
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:252)
      at org.mortbay.jetty.HttpParser$Input.blockForContent(HttpParser.java:843)
      at org.mortbay.jetty.HttpParser$Input.read(HttpParser.java:901)
      at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
      at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
      at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
      at java.io.InputStreamReader.read(InputStreamReader.java:167)
      at java.io.BufferedReader.fill(BufferedReader.java:136)
      at java.io.BufferedReader.readLine(BufferedReader.java:299)
      at java.io.BufferedReader.readLine(BufferedReader.java:362)
      at com.knoa.server.thor.ThorInMessage.execute(ThorInMessage.java:190)
      at com.knoa.server.thor.ThorServlet.doPost(ThorServlet.java:467)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:442)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:357)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
      at org.mortbay.jetty.Server.handle(Server.java:272)
      at org.mortbay.jetty.HttpConnection.handlerRequest(HttpConnection.java:396)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:666)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:613)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:194)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:311)
      at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:182)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

      java.io.IOException: FULL
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:252)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:194)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:311)
      at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:182)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

        Activity

        Hide
        Greg Wilkins added a comment -

        The size is not being used as an identifier... simply to pick a pool of same sized buffers.

        But you should not get this exception?!?!?

        Can you tell me more about your application and the tpye of request this happens for?

        Show
        Greg Wilkins added a comment - The size is not being used as an identifier... simply to pick a pool of same sized buffers. But you should not get this exception?!?!? Can you tell me more about your application and the tpye of request this happens for?

          People

          • Assignee:
            Unassigned
            Reporter:
            Bogdan Calmac
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: