-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Update local locking logic #1842
Conversation
This patch is made to address some issues with local locking, that is the locking that deals with the .pid files typically in each machines /tmp/luigi folder. There's one bugfix (can massively improve startup performence): * Don't keep old entries in the .pid files There's one change in logic: * When running with --take-lock, only allow for one "additional" task being run, the previous behavior was that --take-lock tasks always could keep running. With this new behavior, it could perhaps be possible to always cron your lines with --take-lock. Lastly, there was much refactoring of the code. Although longer, I find the readability to have drastcially improved.
@Tarrasch, thanks for your PR! By analyzing the annotation information on this pull request, we identified @daveFNbuck, @erikbern and @gpoulin to be potential reviewers |
@daveFNbuck, can you review this? At least the part regarding the changed behaviour in |
I intended This ended up not working very well for me and I haven't used it for a while. The main problem was that it was hard to guarantee that I'd have any assistants running at all. If the running assistant died for any reason, nothing would run until the next deploy. This could cause big problems if it happened over the night or on the weekend. Your change would make this much more likely to happen, even if I also used a cron job. A couple long-running jobs on each assistant and nothing new would ever launch. I'm ok with removing I'm currently trying to run lots of 1-worker assistants with supervisor. With each deploy, I send SIGUSR1 to all of them and the supervisor ensures that they come back up. This seems to be more reliable so far but I still have some issues I haven't figured out yet. |
Thanks for sharing your experience @daveFNbuck. I pretty clearly understand your issues and your tried attempts. What do you think the following setup? Assuming the behaviour introduced in this PR: Well. What about hourly cronning
Whatever we do, I really don't like the old behaviour, as it seems like "everything" changes when you supply |
I don't like the old behavior either and I don't use |
If nobody objects (please feel free to objects/review), I'll merge this early next week :) (I'm off 2 days) |
Motivation and Context
This patch is made to address some issues with local locking, that is
the locking that deals with the .pid files typically in each machines
/tmp/luigi folder.
There's one bugfix (can massively improve startup performence):
There's one change in logic:
being run, the previous behavior was that --take-lock tasks always
could keep running. With this new behavior, it could perhaps be
possible to always cron your lines with --take-lock.
Lastly, there was much refactoring of the code. Although longer, I find
the readability to have drastcially improved.
Have you tested this? If so, how?
There are added unittests for the two behavioural changes. I verified that they didn't pass before.
Furthermore I'll let this run for me a few days before merging, just in case.