-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jobs: fix job 'running state' #1927
Conversation
Reading the docstring gives a clue. It says something about only setting/clearing the running flag if not already set by the caller. Also, looks like I gotta kick Travis again later. Yay. /s |
Yeah but it's not used really because when the job is a thread the "is running" flag is set, so it's not clear inside the execute function. Which is probably the real bug here. But heh. I'll fix the docstring, that will probably kick Travis. |
@Exirel I came back to properly review this but the docstring fix isn't done yet. :S Guess the real question is: Is a threaded job always considered |
@dgw the goal is to prevent such job to run multiple time in parallel. Like, you have a job and you want it in a thread because it takes, like, 30s. It's fine, since it' should run only every 5min, but then you have a very weird case where it takes more than 5 mins, and "oh no" you don't want it to run again. I think I wanted to be "too smart" with the In short: sloppy job on my part. Will fix the docstring asap. Soon. This week. |
a6fa7d5
to
1b9869d
Compare
So, the problem was: job's "running" state was never clear. So of course, they would execute once, and never again. I did some sloppy job at tracking down how this state was set and clear, and messed up what was responsible for what. Now: * the job scheduler still set `job.is_running` before running it in a thread * the `job.execute` method doesn't handle the running state anymore * the job scheduler `_call` wrapper now uses `with job` to manage the job's state This should work. This time.
1b9869d
to
82dcbe0
Compare
OK fixed it. Quick note about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this onto master
🚢
Description
For some reason it was broken? I don't understand what happened here. I'll probably have to investigate further to understand the "why did I do that?" later. That will do at the moment, so no worries.
Checklist
make qa
(runsmake quality
andmake test
)