glassfish
  1. glassfish
  2. GLASSFISH-19537

servlet-3.1 upgradeEcho test hangs occasionally due to incorrect InputStream.read

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b70
    • Fix Version/s: 4.0_b72_EE7MS4
    • Component/s: web_container
    • Labels:
      None

      Description

      When the servlet-3.1/upgradeEcho test passes, InputStream.read returns "/Hello" and "/World" in the same order as OutputStream.write is invoked.

      [java] Sleeping 1 sec
      [java] HTTP/1.1 101 Web Socket Protocol Handshake
      [java] X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 4.0 Java/Oracle Corporation/1.7)
      [java] Server: GlassFish Server Open Source Edition 4.0
      [java] Upgrade: echo
      [java] Connection: Upgrade
      [java]
      [java] /Hello counter=1
      [java] /World counter=2

      However, occasionally, InputStream.read returns "/Hello/World" together rather than two separate read calls not incrementing the counter and the test hangs.

      [java] Sleeping 1 sec
      [java] HTTP/1.1 101 Web Socket Protocol Handshake
      [java] X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 4.0 Java/Oracle Corporation/1.7)
      [java] Server: GlassFish Server Open Source Edition 4.0
      [java] Upgrade: echo
      [java] Connection: Upgrade
      [java]
      [java] /Hello/World counter=1

      Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.5-b02 mixed mode):

      "Attach Listener" daemon prio=10 tid=0x000000000221f000 nid=0x622 runnable [0x0000000000000000]
      java.lang.Thread.State: RUNNABLE

      "pool-2-thread-2" prio=10 tid=0x00007f491843e000 nid=0x342d waiting on condition [0x00007f491d083000]
      java.lang.Thread.State: WAITING (parking)
      at sun.misc.Unsafe.park(Native Method)

      • parking to wait for <0x00000000c4ec5e78> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)

      "pool-2-thread-1" prio=10 tid=0x00007f4918550800 nid=0x342c waiting on condition [0x00007f491cdfd000]
      java.lang.Thread.State: WAITING (parking)
      at sun.misc.Unsafe.park(Native Method)

      • parking to wait for <0x00000000c4ec5e78> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)

      "Keep-Alive-SocketCleaner" daemon prio=10 tid=0x0000000001f24800 nid=0x32a6 in Object.wait() [0x00007f491cbfb000]
      java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)

      • waiting on <0x00000000c2cc42f8> (a sun.net.www.http.KeepAliveStreamCleaner)
        at sun.net.www.http.KeepAliveStreamCleaner.run(KeepAliveStreamCleaner.java:101)
      • locked <0x00000000c2cc42f8> (a sun.net.www.http.KeepAliveStreamCleaner)
        at java.lang.Thread.run(Thread.java:722)

      "Service Thread" daemon prio=10 tid=0x00007f4918006800 nid=0x7505 runnable [0x0000000000000000]
      java.lang.Thread.State: RUNNABLE

      "C2 CompilerThread1" daemon prio=10 tid=0x00007f4918004000 nid=0x7504 waiting on condition [0x0000000000000000]
      java.lang.Thread.State: RUNNABLE

      "C2 CompilerThread0" daemon prio=10 tid=0x00007f4918001000 nid=0x7503 waiting on condition [0x0000000000000000]
      java.lang.Thread.State: RUNNABLE

      "Signal Dispatcher" daemon prio=10 tid=0x0000000001dc4000 nid=0x7502 runnable [0x0000000000000000]
      java.lang.Thread.State: RUNNABLE

      "Finalizer" daemon prio=10 tid=0x0000000001d73000 nid=0x7501 in Object.wait() [0x00007f491e18f000]
      java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)

      • waiting on <0x00000000c2c6e618> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
      • locked <0x00000000c2c6e618> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)

      "Reference Handler" daemon prio=10 tid=0x0000000001d6b800 nid=0x7500 in Object.wait() [0x00007f491e290000]
      java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)

      • waiting on <0x00000000c2c6e168> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:503)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
      • locked <0x00000000c2c6e168> (a java.lang.ref.Reference$Lock)

      "main" prio=10 tid=0x0000000001cdb000 nid=0x74fa runnable [0x00007f4927c43000]
      java.lang.Thread.State: RUNNABLE
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:150)
      at java.net.SocketInputStream.read(SocketInputStream.java:121)
      at java.net.SocketInputStream.read(SocketInputStream.java:107)
      at WebTest.main(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
      at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
      at org.apache.tools.ant.taskdefs.Java.run(Java.java:747)
      at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:201)
      at org.apache.tools.ant.taskdefs.Java.execute(Java.java:104)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:357)
      at org.apache.tools.ant.Target.performTasks(Target.java:385)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:357)
      at org.apache.tools.ant.Target.performTasks(Target.java:385)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
      at org.apache.tools.ant.Main.runBuild(Main.java:698)
      at org.apache.tools.ant.Main.startAnt(Main.java:199)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

      "VM Thread" prio=10 tid=0x0000000001d63800 nid=0x74ff runnable

      "GC task thread#0 (ParallelGC)" prio=10 tid=0x0000000001ce8800 nid=0x74fb runnable

      "GC task thread#1 (ParallelGC)" prio=10 tid=0x0000000001cea800 nid=0x74fc runnable

      "GC task thread#2 (ParallelGC)" prio=10 tid=0x0000000001cec800 nid=0x74fd runnable

      "GC task thread#3 (ParallelGC)" prio=10 tid=0x0000000001cee000 nid=0x74fe runnable

      "VM Periodic Task Thread" prio=10 tid=0x00007f4918011800 nid=0x7506 waiting on condition

      JNI global references: 163

        Activity

        Hide
        Shing Wai Chan added a comment -

        fix test case:
        Sending upgradeEcho/WebTest.java
        Sending upgradeEcho/servlet/test/EchoHttpUpgradeHandler.java
        Transmitting file data ..
        Committed revision 58624.

        Show
        Shing Wai Chan added a comment - fix test case: Sending upgradeEcho/WebTest.java Sending upgradeEcho/servlet/test/EchoHttpUpgradeHandler.java Transmitting file data .. Committed revision 58624.

          People

          • Assignee:
            Shing Wai Chan
            Reporter:
            Amy Roh
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: