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

Expand and encourage use of hash syntax in crontabs

      Jenkins supports H in crontab specification to balance load across different times of day in a predictable yet natural way, so you do not get sudden spikes of activity. Special syntaxes like @daily use this automatically. And you can use it explicitly in five-field specs for more control.

      Yet the H syntax is not widely used, and it is not powerful enough to handle e.g. jobs which should be triggered every quarter hour. The result is terrible performance on large installations where a lot of people innocently configure triggers that all go off at once.

      Suggested changes:

      1. Expand the syntax to support e.g. H/15 * * * * for a trigger to run every fifteen minutes according to hash (e.g. 3, 18, 33, and 48 minutes past the hour).
      2. Update inline help to advocate hash syntax as the normal usage, and warn that misuse of exact times can overload the system.
      3. Provide form validation that flags use of exact times as a warning and suggests the hash syntax to use instead.
      4. Supply a standalone utility function which may be run to make that transformation in bulk across a bunch of job configs.

          [JENKINS-17311] Expand and encourage use of hash syntax in crontabs

          Jesse Glick created issue -
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/scheduler/CronTab.java
          core/src/test/java/hudson/scheduler/CronTabTest.java
          http://jenkins-ci.org/commit/jenkins/7f92a9bd1a003b81419e5b9142f2592da608eb43
          Log:
          JENKINS-17311 Improved hashify to detect manual skip idiom.


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/scheduler/CronTab.java core/src/test/java/hudson/scheduler/CronTabTest.java http://jenkins-ci.org/commit/jenkins/7f92a9bd1a003b81419e5b9142f2592da608eb43 Log: JENKINS-17311 Improved hashify to detect manual skip idiom. – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/c4760b472c8c54c874b043502a1a6892532ba07a
          Log:
          recording JENKINS-17311

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/c4760b472c8c54c874b043502a1a6892532ba07a Log: recording JENKINS-17311

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2410

          Result = SUCCESS

          dogfood added a comment - Integrated in jenkins_main_trunk #2410 Result = SUCCESS

          alex_g added a comment -

          should the ticket status set to Resolved and Resolution to Fixed? (i have seen this feature in current jenkins 1.514)
          to 4.: bulk job config changes can be done with https://wiki.jenkins-ci.org/display/JENKINS/Configuration+Slicing+Plugin ('SCM Timer Trigger Slicer'/'Timer Trigger Slicer')

          alex_g added a comment - should the ticket status set to Resolved and Resolution to Fixed? (i have seen this feature in current jenkins 1.514) to 4.: bulk job config changes can be done with https://wiki.jenkins-ci.org/display/JENKINS/Configuration+Slicing+Plugin ('SCM Timer Trigger Slicer'/'Timer Trigger Slicer')

          Jesse Glick added a comment -

          @alex_g indeed this was in 1.510. Looks like the JIRA daemon failed to mark it as resolved when it was merged, I think because Kohsuke merged it manually and so lost the FIXED comment in the pull request title.

          Regarding point #4, CronTab.hashify performs this specific function. The Configuration Slicing plugin could not do the same unless it is updated to a 1.510+ core dependency and calls this method, or copies its implementation.

          Jesse Glick added a comment - @alex_g indeed this was in 1.510. Looks like the JIRA daemon failed to mark it as resolved when it was merged, I think because Kohsuke merged it manually and so lost the FIXED comment in the pull request title. Regarding point #4, CronTab.hashify performs this specific function. The Configuration Slicing plugin could not do the same unless it is updated to a 1.510+ core dependency and calls this method, or copies its implementation.
          Jesse Glick made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Chris Wozny made changes -
          Labels Original: performance trigger New: lts-candidate performance trigger

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: