Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-3242

CRON scheduling can occur twice for the same trigger

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None

      Description

      Initially brought up in this message[1] to the user list.

      The logic for CRON scheduling is done here[2]. The CRON expression is evaluated and used to check when to schedule the next trigger[3]. I believe problems arise due to the approximate nature of the java scheduler and potentially the millisecond portion of quartz scheduler getting wiped here[4] can lead to the behavior seen in the mailing list (an extra invocation right before the correct time).

      [1] http://mail-archives.apache.org/mod_mbox/nifi-users/201612.mbox/%3C1482106268095-481.post%40n4.nabble.com%3E
      [2] https://github.com/apache/nifi/blob/c10d11d378ffd7c3044446830e24d50c5befc98a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/QuartzSchedulingAgent.java#L177-L177
      [3] https://github.com/apache/nifi/blob/c10d11d378ffd7c3044446830e24d50c5befc98a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/QuartzSchedulingAgent.java#L180
      [4] https://github.com/quartz-scheduler/quartz/blob/quartz-2.2.1/quartz-core/src/main/java/org/quartz/CronExpression.java#L1170

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                JPercivall Joseph Percivall
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: