You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using splay in cron schedule throws exception "unsupported operand type(s) for +: 'NoneType' and 'int'" #44583
I want to add a scheduled job so that all my minions run a highstate every night. When I set a fixed time for the job, everything works. However, when I add a splay time, the scheduled jobs aren't executed, and the minion logs contain only:
2017-11-17 14:56:00,089 [salt.minion ][ERROR ][18156] Exception unsupported operand type(s) for +: 'NoneType' and 'int' occurred in scheduled job
I added logging output to utils/schedule.py which points to the error coming from this line, which adds the randomised splay time. When it runs, data['_next_fire_time'] is None, which obviously cannot be added to.
That None, in turn, is explicitly set a few lines before, in code added by @vutny in 6f967ac, which I do not know enough Salt internals to understand the rationale for.
It is very possible, that when I tried to fix one thing, I've broke another one.
I rely on Salt's Job Scheduler very hard in my recent project, so I will try to look at this issue in the nearest future.
@creideiki Okay, this appeared to be more complicated than I initially thought 😅
I have pushed another fix in my PR, and I believe it should work with all type of schedules as well.
Could you please make another test?
Activity
vutny commentedon Nov 20, 2017
Hi @creideiki
It is very possible, that when I tried to fix one thing, I've broke another one.
I rely on Salt's Job Scheduler very hard in my recent project, so I will try to look at this issue in the nearest future.
Thanks for reporting.
vutny commentedon Nov 22, 2017
@creideiki I have attempted to fix this in PR #44640, would you mind to test the patch? Thanks a lot.
creideiki commentedon Nov 22, 2017
With #44640 applied on the minions (but not on the master), the jobs now run, but all run at exactly the set time. Splay time is not applied.
vutny commentedon Nov 22, 2017
@creideiki Okay, this appeared to be more complicated than I initially thought 😅
I have pushed another fix in my PR, and I believe it should work with all type of schedules as well.
Could you please make another test?
creideiki commentedon Nov 22, 2017
I ran ee9fedf with a schedule of
Let it run for three iterations (15 minutes). Seems to work so far.
vutny commentedon Nov 22, 2017
@creideiki Awesome! Thank you for the feedback.
Merge pull request #44640 from vutny/fix-cron-schedule-splay