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

H/2 * * * * is polling every second minute, but H/1 * * * * only once per hour

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None
    • SVN, Windows, 1.532.2

      H/2 * * * * is polling every second minute.
      H/1 * * * * is polling once per hour.
      This is confusing.

      H/1 * * * * should instead poll once per minute, but with an offset of a random number of seconds.

          [JENKINS-22129] H/2 * * * * is polling every second minute, but H/1 * * * * only once per hour

          Edgars Batna added a comment -

          Please don't pile inconsistency. Resolve it so that people learning to use Jenkins don't waste hours looking for such pathetically simple answers while trying to set up a simple timer trigger.

          Edgars Batna added a comment - Please don't pile inconsistency. Resolve it so that people learning to use Jenkins don't waste hours looking for such pathetically simple answers while trying to set up a simple timer trigger.

          Daniel Beck added a comment -

          Resolve it so that people learning to use Jenkins don't waste hours looking for such pathetically simple answers while trying to set up a simple timer trigger.

          A job that is supposed to run once per hour/day/week/month would suddenly run up to 60 times during a one hour period if we were to change this. I can only imagine the havoc this could cause.

          Would amending https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html#L34 as below work?

          steps by intervals of X through the specified range or whole valid range. X needs to be 2 or more; use * for all values.

          Daniel Beck added a comment - Resolve it so that people learning to use Jenkins don't waste hours looking for such pathetically simple answers while trying to set up a simple timer trigger. A job that is supposed to run once per hour/day/week/month would suddenly run up to 60 times during a one hour period if we were to change this. I can only imagine the havoc this could cause. Would amending https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html#L34 as below work? steps by intervals of X through the specified range or whole valid range. X needs to be 2 or more; use * for all values.

          Edgars Batna added a comment -

          Amending the help would help.

          But... can't you fix this in 2.0+ and amend the help in older release? We're already on the latest Jenkins and things are already expected to break. Unless your backup strategy is very lacking, I do not see how improper configuration (which it sort of is) should hamper resolving an inconsistency. You can mention it in the changelog. I know I *always *read them.

          Edgars Batna added a comment - Amending the help would help. But... can't you fix this in 2.0+ and amend the help in older release? We're already on the latest Jenkins and things are already expected to break. Unless your backup strategy is very lacking, I do not see how improper configuration (which it sort of is) should hamper resolving an inconsistency. You can mention it in the changelog. I know I *always *read them.

          chin ho added a comment -

          I got burned by this today. It's ridiculous to label this as "minor inconsistency" and let users waste their time on figuring out what's wrong.

          chin ho added a comment - I got burned by this today. It's ridiculous to label this as "minor inconsistency" and let users waste their time on figuring out what's wrong.

          Mike Kobit added a comment -

          Was also hit by this, and it is indeed extremely confusing.

          Mike Kobit added a comment - Was also hit by this, and it is indeed extremely confusing.

          Either way this is confusing and should either be changed in the docs to explain the difference in behaviour or fixed in the code.  I got hit by this as well when scheduling hourly:

          • H H/1 * * *  Schedules pseudo randomly once a day rather than hourly (even though Jenkins itself suggest this will work for scheduling hourly - I'm aware that H H * * * means pseudo randomly once a day)
          • H H/2 * * *  Schedules pseudo randomly every 2 hours 

          So, H/1 means H, but H/N where N>2 means pseudo randomly every Nth step.  Highly illogical captain!

          Anthony Butler added a comment - Either way this is confusing and should either be changed in the docs to explain the difference in behaviour or fixed in the code.  I got hit by this as well when scheduling hourly: H H/1 * * *  Schedules pseudo randomly once a day rather than hourly (even though Jenkins itself suggest this will work for scheduling hourly - I'm aware that H H * * * means pseudo randomly once a day) H H/2 * * *  Schedules pseudo randomly every 2 hours  So, H/1 means H, but H/N where N>2 means pseudo randomly every Nth step.  Highly illogical captain!

          Daniel Beck added a comment -

          jenkinsan Could you please clarify what you mean when you write:

          even though Jenkins itself suggest this will work for scheduling hourly

          Daniel Beck added a comment - jenkinsan Could you please clarify what you mean when you write: even though Jenkins itself suggest this will work for scheduling hourly

          Anthony Butler added a comment - - edited

          danielbeck

          Sure. 

          Type the following into the Build Triggers>Build periodically>Schedule field under Job Configuration:

          • * H/1 * * *

          Now look at the suggestion:
          "Do you really mean "every minute" when you say "* H/1 * * *"? Perhaps you meant "H H/1 * * *" to poll once per hour"

          Anthony Butler added a comment - - edited danielbeck Sure.  Type the following into the Build Triggers>Build periodically>Schedule field under Job Configuration: * H/1 * * * Now look at the suggestion: "Do you really mean "every minute" when you say "* H/1 * * *"? Perhaps you meant "H H/1 * * *" to poll once per hour"

          Amit Shah added a comment -

          Below expression is not working as expected.
          Build Triggers > Build periodically > Schedule = H H(0-23)/5 * 3 1-6

          It should run every 5 hours in weekdays of March but It is running once in 24 hours.

          Amit Shah added a comment - Below expression is not working as expected. Build Triggers > Build periodically > Schedule = H H(0-23)/5 * 3 1-6 It should run every 5 hours in weekdays of March but It is running once in 24 hours.

          Stanisław added a comment -

          Please speed up in solving the issue. Because of such bugs Jenkins has "bad" reputation.

          Stanisław added a comment - Please speed up in solving the issue. Because of such bugs Jenkins has "bad" reputation.

            anderl86 Andreas K
            mkarg Markus KARG
            Votes:
            14 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated: