Skip to content

Fix #44583: splay with cron-like scheduled jobs - #44640

Merged
rallytime merged 2 commits into
saltstack:2017.7from
vutny:fix-cron-schedule-splay
Nov 30, 2017
Merged

rallytime merged 2 commits into
saltstack:2017.7from
vutny:fix-cron-schedule-splay

Conversation

@vutny

@vutny vutny commented Nov 22, 2017 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Tries to add "splay" time only if next job fire time is still in the future for cron tasks.

What issues does this PR fix or reference?

#44583

Previous Behavior

Using splay with cron expression in scheduled job definition makes it fail each time when execution should be triggered.

New Behavior

Scheduled "cron" job should be triggered if next fire time with addition of "splay" time has already passed in current loop interval.

Tests written?

YES, added 4 basic test cases for eval() function.

Commits signed with GPG?

Yes

@cachedout

Copy link
Copy Markdown
Contributor

Hi @vutny

Two things. First, this needs to go into the develop branch, please. Second, it needs some unit tests added. Thanks.

@vutny

vutny commented Nov 23, 2017

Copy link
Copy Markdown
Contributor Author

Hi @cachedout

This PR is intended to fix the feature, that supposed to work in releases 2017.7.X, but was probably broken with previous changes (also made by me 😈 ). It would be very sad if it would remain non-working during all 2017.7 life-time.
Please-please, consider to include it in current stable version.
I could work on some unit tests in scope of this PR if you prefer, or submit a subsequent one.

FYI @creideiki

@creideiki

creideiki commented Nov 23, 2017 •

Copy link
Copy Markdown
Contributor

@cachedout What @vutny said.

I hit the referenced issue (#44583) while trying to use functionality that is documented to be in 2017.7, but doesn't work there. I would strongly prefer getting this bugfix in the next stable update for 2017.7, instead of having to wait for the next major release.

@rallytime

Copy link
Copy Markdown
Contributor

@vutny If you could add some unit tests to this PR that would be greatly appreciated. We of course want to fix bugs in the stable releases as best as we can, but we certainly don't want to add regressions there inadvertently.

@rallytime rallytime added the needs-testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label Nov 27, 2017
@vutny

vutny commented Nov 28, 2017

Copy link
Copy Markdown
Contributor Author

Will do!

@vutny

vutny commented Nov 29, 2017

Copy link
Copy Markdown
Contributor Author

@rallytime I've added 4 very basic unit tests to verify that periodic time definitions and cron-like schedules are parsed correctly and splay setting is taken into an account. I hope this would be a good start.
I think I could add some more in future PRs.

@rallytime rallytime removed the needs-testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label Nov 29, 2017
@rallytime

Copy link
Copy Markdown
Contributor

@vutny Great! Thank you for adding those.

@rallytime

Copy link
Copy Markdown
Contributor

re-run py3

Try to add "splay" time only if next job fire time is
still in the future for cron and other type of schedules.
@rallytime
rallytime merged commit 06fb80b into saltstack:2017.7 Nov 30, 2017
@vutny
vutny deleted the fix-cron-schedule-splay branch November 30, 2017 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants