woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.26k stars 369 forks source link

Skip missed cronjobs and add delay for cronjobs on server start #2188

Closed dr460nf1r3 closed 1 year ago

dr460nf1r3 commented 1 year ago

Component

server

Describe the bug

Currently, it seems that missed cronjobs are getting executed when the instance starts up the next time.

In the environment I'm currently using Woodpecker, it is utilized to run Ansible playbooks at given times. This also includes scheduled server updates & reboots.

In the case of having the Woodpecker instance down & started up afterward, all those jobs are getting executed at once, causing servers to reboot when they absolutely should not.

I'm not sure whether this is an actual bug or just how the cron feature works, though this is kind of a dangerous behavior depending on what kind of tasks are dedicated to Woodpecker.

The proposal is to either change the behavior to not run missed crons at startup or to provide a way to turn it off.

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"1.0.0"}

Additional context

No response

Validations

6543 commented 1 year ago

hmm so you propose an enhancement, to skip missed crone execs ... and delay cron job init on startup ?

dr460nf1r3 commented 1 year ago

If you'd label it as enhancement, then yes, I'm proposing this to take away some of the destructiveness of cronjobs running at the wrong times.