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

Looping for scheduled events

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • 10.1.0
    • 9.6.4, 10.0.1
    • None
    • None

      Steps to Reproduce

      1. Tested on ZK Fiddle: https://zkfiddle.org/sample/38r3vl2/1-Looping-for-ON-Scheduled-Events
        Create and schedule an event that throws an Exception.

      Current Result

      ZK starts a looping.

      Expected Result

      The exception should just be thrown once.

      Debug Information

      When an exception occurs, there is a failure in event execution and proper removal from the queue. Thus, the line responsible for removing the event from the list of events (_schedInfos) that need processing is not executed.

      Subsequent events in the queue are processed, restarting the index count used to retrieve events that require treatment (_scheduleInfoReadCount). This results in the repetition of the original event, which fails again and remains in the cache. The cycle persists until the iDempiere service crashes or until the cache (_schedInfos) is cleared after 10 minutes.

      DesktopImpl.ScheduleListener.onEvent code

      Line 1894 should have a fallback in case of exceptions to remove it from the list of events to be executed, avoiding loops.

      Workaround

      A workaround to avoid the looping to happens is to apply the needed treatments at the scheduled event to avoid the exception to be thrown.
      This prevents the loop to be started at the specific case, if any new exception is discovered, it should be also treated.
      DesktopImpl.java

            jumperchen jumperchen
            MarcosFavaretto MarcosFavaretto
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: