glassfish
  1. glassfish
  2. GLASSFISH-1916

BufferUnderflowException when GlassFish is fronted with lbplugin

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.1pe
    • Fix Version/s: 9.0pe
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,916

      Description

      Reported by Jothir Ganesan:

      I was executing a list of tests for testing the high availability and session
      failover features of appserver. Our tests typically does the following:

      • start the cluster
      • send a(or 2-3) request(s) throught the lbplugin to the instance in a cluster.
        The instance listed first in Loadbalancer.xml serves the request. (In our case,
        it is instance1)
      • stop and start the instance(say instance1) that handled the request
      • send the next (remaining) request(s) to check for session availability.
      • Undeploy the app.

      For the first few tests, instance1 handled the requests and was working fine.
      After ~10 tests, instance 1 threw the exception given below:

      [#|2007-01-04T17:19:06.173+0530|WARNING|sun-appserver-ee9.1|GRIZZLY|_ThreadID=13;_ThreadName=httpSSLWorkerThread-1111-0;_RequestID=31671a9f-7684-44b2-af0e-4bd7eb981122;|PortUnification
      exception
      java.nio.BufferUnderflowException
      at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:127)
      at java.nio.ByteBuffer.get(ByteBuffer.java:674)
      at
      com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.cancel(PortUnificationPipeline.java:386)
      at
      com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:344)
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
      at
      com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)

      #]

      [#|2007-01-04T17:19:11.184+0530|WARNING|sun-appserver-ee9.1|GRIZZLY|_ThreadID=14;_ThreadName=httpSSLWorkerThread-1111-1;_RequestID=4df046c1-87c0-4def-90d0-0e429cafa0ea;|PortUnification
      exception
      java.nio.BufferUnderflowException
      at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:127)
      at java.nio.ByteBuffer.get(ByteBuffer.java:674)
      at
      com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.cancel(PortUnificationPipeline.java:386)
      at
      com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:344)
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
      at
      com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)

      #]

      [#|2007-01-04T17:19:15.859+0530|INFO|sun-appserver-ee9.1|javax.ee.enterprise.system.tools.synchronization|_ThreadID=15;_ThreadName=RMI
      TCP Connection(37)-10.12.163.192;|SYNC062: Synchronization for SimpleSession is
      complete. Total time spent 711 milli second(s).|#]

      [#|2007-01-04T17:19:15.926+0530|INFO|sun-appserver-ee9.1|javax.enterprise.system.stream.out|_ThreadID=15;_ThreadName=RMI
      TCP Connection(37)-10.12.163.192;|
      IN HaWebmethodSessionStrategyBuilder NEW|#]

      [#|2007-01-04T17:19:15.928+0530|INFO|sun-appserver-ee9.1|javax.enterprise.system.container.web|_ThreadID=15;_ThreadName=RMI
      TCP Connection(37)-10.12.163.192;/SimpleSession;ha;web-method;session;|WEB0130:
      Enabling ha-based persistence for web module [/SimpleSession]'s sessions:
      persistence-type = [ha] / persistenceFrequency = [web-method] / persistenceScope
      = [session]|#]

      [#|2007-01-04T17:19:16.194+0530|WARNING|sun-appserver-ee9.1|GRIZZLY|_ThreadID=13;_ThreadName=httpSSLWorkerThread-1111-0;_RequestID=31671a9f-7684-44b2-af0e-4bd7eb981122;|PortUnification
      exception
      java.nio.BufferUnderflowException
      at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:127)
      at java.nio.ByteBuffer.get(ByteBuffer.java:674)
      at
      com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.cancel(PortUnificationPipeline.java:386)
      at
      com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:344)
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
      at
      com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)

      #]

      [#|2007-01-04T17:19:21.206+0530|WARNING|sun-appserver-ee9.1|GRIZZLY|_ThreadID=14;_ThreadName=httpSSLWorkerThread-1111-1;_RequestID=4df046c1-87c0-4def-90d0-0e429cafa0ea;|PortUnification
      exception
      java.nio.BufferUnderflowException
      at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:127)
      at java.nio.ByteBuffer.get(ByteBuffer.java:674)
      at
      com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.cancel(PortUnificationPipeline.java:386)
      at
      com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:344)
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
      at
      com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)

      #]

      and instance1 was not serving requests any more. instance1 was unhealthy, so
      lbplugin routed the requests to instance2. But after a few number of tests,
      instance2 became not reachable because of the same exception. Finally, instance
      3 is handling the requests and is throwing the same exception.......

        Activity

        Hide
        jfarcand added a comment -

        ...

        Show
        jfarcand added a comment - ...
        Hide
        gfbugbridge added a comment -

        <BT6510143>

        Show
        gfbugbridge added a comment - <BT6510143>
        Hide
        jfarcand added a comment -

        The exception is caused because of a wrong logic when logging an exception.
        Fixed the logging part. Now we need to find what kind of bytes packet the
        lbplugin is sending, making the port unification mechanism unable to determine
        the protocol.

        Checking in PortUnificationPipeline.java;
        /cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/PortUnificationPipeline.java,v
        <-- PortUnificationPipeline.java
        new revision: 1.12; previous revision: 1.11
        done

        Show
        jfarcand added a comment - The exception is caused because of a wrong logic when logging an exception. Fixed the logging part. Now we need to find what kind of bytes packet the lbplugin is sending, making the port unification mechanism unable to determine the protocol. Checking in PortUnificationPipeline.java; /cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/PortUnificationPipeline.java,v <-- PortUnificationPipeline.java new revision: 1.12; previous revision: 1.11 done
        Hide
        jfarcand added a comment -

        The workaround is to remove

        <property name="proxiedProtocols" value="..."/>

        Show
        jfarcand added a comment - The workaround is to remove <property name="proxiedProtocols" value="..."/>
        Hide
        jfarcand added a comment -

        Make sure no tentative to sent bytes when the connection has been closed.

        Checking in PortUnificationPipeline.java;
        /cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/PortUnificationPipeline.java,v
        <-- PortUnificationPipeline.java
        new revision: 1.13; previous revision: 1.12
        done

        Show
        jfarcand added a comment - Make sure no tentative to sent bytes when the connection has been closed. Checking in PortUnificationPipeline.java; /cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/PortUnificationPipeline.java,v <-- PortUnificationPipeline.java new revision: 1.13; previous revision: 1.12 done

          People

          • Assignee:
            jfarcand
            Reporter:
            jfarcand
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: