cron icon indicating copy to clipboard operation
cron copied to clipboard

[FEATURE] Add support for Jenkins-style 'H' hashed field value

Open dmayle opened this issue 5 years ago • 4 comments

As mentioned in the wikipedia on cronspecs, Jenkins supports a new field value 'H' (or 'H/15', etc.) which is used to specify a random stable offset within the schedule. Jenkins hashes (hence the 'H') the job name to to allow you to give the same schedule to multiple jobs without running into the thundering herd problem.

In order to support this, the API would need to change to allow passing in a job name to use for hashing.

This would make it easier to schedule recurring jobs on kubernetes.

dmayle avatar May 07 '20 17:05 dmayle

Interestingly enough, #307 is a feature request for adding a job name.

dmayle avatar May 07 '20 17:05 dmayle

I need to schedule hundreds of jobs with similar schedule, where this feature will be immensely useful.

alokpr avatar Oct 25 '20 03:10 alokpr

Any updates to this issue? Top-of-the-hour thundering herd is an easily preventable problem. I would love to change @hourly to H * * * * * where H renders to the hash of the Job Name, PID, hostname, or something pseudo-random. Or, instead of H, R for random.

sean- avatar Dec 05 '23 07:12 sean-