Skip to content

Support some type of jitter or randomness to avoid many jobs starting at the same time when it does not really matter. #6

@norman-abramovitz

Description

@norman-abramovitz

Jenkins uses the H symbol to represent the randomness of startup times.

https://www.jenkins.io/doc/book/pipeline/syntax/#cron-syntax

The H symbol can be used with a range. For example, H H(0-7) * * * means some time 
between 12:00 AM (midnight) to 7:59 AM. You can also use step intervals with H, with or 
without ranges.

The H symbol can be thought of as a random value over a range, but it actually is a hash 
of the job name, not a random function, so that the value remains stable for any given project.

Beware that for the day of month field, short cycles such as */3 or H/3 will not work consistently 
near the end of most months, due to variable month lengths. For example, */3 will run on 
the 1st, 4th, …31st days of a long month, then again the next day of the next month. Hashes are 
always chosen in the 1-28 range, so H/3 will produce a gap between runs of between 3 and 6 days
at the end of a month. Longer cycles will also have inconsistent lengths, but the effect may 
be relatively less noticeable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions