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

Fix recovering desktop (FailoverManager)

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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