Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22431

Rewrite Trigger.Cron to be an AperiodicWork

XMLWordPrintable

      Currently Trigger.Cron runs every minute, checking whether any triggers are supposed to be run now. (If the task is delayed for some reason, it can check triggers in multiple waves, one per elapsed minute.) This works, but it means that if a job is not run at the expected time for some reason, the logging is nearly useless since there will be one entry per job per minute, even if jobs are set to run only at long intervals, so the log is mostly noise. Also running every minute probably wastes some CPU.

      Would be better to be an AperiodicWork and calculate when it should next run, for the first job to come up. This would mean keeping a priority queue of jobs, each entry recalculated when either the trigger is run or Trigger.start is called. Such a queue would easily be dumped interactively or logged.

      A complication is the anomalous behavior of SCM synchronous polling (JENKINS-806), which does not use the crontab at all and basically operates on an independent system. Probably this should just be moved into its own plugin.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: