Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3725

Interrupting Executions.activate() stops Server Push

XMLWordPrintable

      Steps to Reproduce

      run the attached example with Comet or Websocket server push enabled
      (runs automatically)
      observe the logs

      Current Result

      T1 waiting to activate ...
      T1 begin
      T2 waiting to activate ...
      T2 interupted waiting for java.lang.InterruptedException
      interrupt thread: T2
      T2 deactivated
      T1 done
      T1 deactivated
      T3 waiting to activate ...
      T4 waiting to activate ...
      

      after 1.5 seconds thread T2 is intentionally interrupted while still waiting for desktop activation
      (because T1 one is blocking the desktop for 2 seconds) -> OK

      after interrupting T2, T3 & T4 keep waiting for a Execution.activation forever (10 minutes) and never get notified to continue, blocking the threads

      Expected Result

      T3 T4 should continue their task
      the log should continue with: (or similar)

      T3 waiting to activate ...
      T3 begin
      T4 waiting to activate ...
      T3 done
      T3 deactivated
      T4 begin
      T4 done
      T4 deactivated
      

      Debug Info

      Comet: when closing the browser tab T3/4 finally get notified that the desktop is no longer available

      T4 deactivated
      T3 deactivated
      T1 waiting to activate ...
      Exception in thread "T4" org.zkoss.zk.ui.DesktopUnavailableException: Stopped
      	at org.zkoss.zkex.ui.comet.CometServerPush.activate(CometServerPush.java:478)
      	at org.zkoss.zk.ui.impl.DesktopImpl.activateServerPush(DesktopImpl.java:1599)
      	at org.zkoss.zk.ui.Executions.activate(Executions.java:1002)
      	at org.zkoss.zk.ui.Executions.activate(Executions.java:973)
      	at zk.support.bugs.WsInterruptingComposer.lambda$1(Unknown Source)
      	at java.lang.Thread.run(Thread.java:748)
      Exception in thread "T3" org.zkoss.zk.ui.DesktopUnavailableException: Stopped
      	at org.zkoss.zkex.ui.comet.CometServerPush.activate(CometServerPush.java:478)
      	at org.zkoss.zk.ui.impl.DesktopImpl.activateServerPush(DesktopImpl.java:1599)
      	at org.zkoss.zk.ui.Executions.activate(Executions.java:1002)
      	at org.zkoss.zk.ui.Executions.activate(Executions.java:973)
      	at zk.support.bugs.WsInterruptingComposer.lambda$1(Unknown Source)
      	at java.lang.Thread.run(Thread.java:748)
      

      When using Websocket Server Push the threads T3/T4 never wake up again, even after the browser tab is closed blocking the threads even longer

      "T3@3751" prio=5 tid=0x24 nid=NA waiting
        java.lang.Thread.State: WAITING
      	  at java.lang.Object.wait(Object.java:-1)
      	  at org.zkoss.zkmax.au.websocket.WebSocketServerPush.checkConnectionReady(WebSocketServerPush.java:255)
      	  at org.zkoss.zkmax.au.websocket.WebSocketServerPush.activate(WebSocketServerPush.java:154)
      	  at org.zkoss.zk.ui.impl.DesktopImpl.activateServerPush(DesktopImpl.java:1599)
      	  at org.zkoss.zk.ui.Executions.activate(Executions.java:1002)
      	  at org.zkoss.zk.ui.Executions.activate(Executions.java:973)
      	  at zk.support.bugs.WsInterruptingComposer.lambda$1(WsInterruptingComposer.java:43)
      	  at zk.support.bugs.WsInterruptingComposer$$Lambda$15.908756461.run(Unknown Source:-1)
      	  at java.lang.Thread.run(Thread.java:748)
      

            wenninghsu wenninghsu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 20 minutes
                3h 20m