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

Fix recovering desktop (FailoverManager)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.2
    • 8.6.1
    • General
    • None
    • ZK 8.6.2 S1

      Steps to Reproduce

      1. Add in zk.xml
        <system-config>
        	<failover-manager-class>org.zkoss.zktest.test.DumbFailoverManager</failover-manager-class>
        </system-config>
        
      2. Run zktest/test/failover.zul
      3. Click the "kill desktop but recoverable" button.
      4. Input "Tom" in the textbox.
      5. Click the "Enter" button.

      Current Result

      Lots of exceptions. The desktop recovering was broken for a long time.

      Expected Result

      The message box with "Hi, Tom" should appear instead of a timeout warning.

      Debug Information

      The desktop ID is not started with "g" anymore.
      After calling setId() in recovering, it would remove then add the desktop.
      https://github.com/zkoss/zk/blob/v8.6.1/zk/src/org/zkoss/zk/ui/impl/DesktopImpl.java#L943,L950

      When a desktop is destroying, _rque is null.
      https://github.com/zkoss/zk/blob/v8.6.1/zk/src/org/zkoss/zk/ui/impl/DesktopImpl.java#L987

      When destroying, the current execution will set as null even in recovering (which shouldn't in this case)
      https://github.com/zkoss/zk/blob/v8.6.1/zk/src/org/zkoss/zk/ui/impl/SimpleDesktopCache.java#L169

      Since this recovered desktop is not considered alive, there would be a lot of troubles.
      https://github.com/zkoss/zk/blob/v8.6.1/zk/src/org/zkoss/zk/ui/impl/DesktopImpl.java#L980

      Workaround

            rudyhuang rudyhuang
            rudyhuang rudyhuang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified