-
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
Let worker wait for tasks running on other workers to complete. #225
Conversation
Break up worker#run into smaller methods and give each a meaningful name so it's easier to figure out what it's doing and allow code reuse. Collapse duplicate if constructs.
Nice! However I think it should be configurable and default should be the existing behavior. As I just pointed out in issue #222, there might be some side effects like creating hundreds of worker processes just sitting around waiting for more work. So I'd rather make this an "experimental" feature that you can turn on if needed. Does that make sense? |
I see where you are coming from. I guess I am using luigi slightly differently, and was operating under the assumption that all submitted tasks get run eventually unless there is a failure of some sort. There is a real risk that the corner case you described could occur, especially if workflows are scheduled every minute. I will add a configuration option named |
If - running tasks is non-empty, then another worker is running my tasks - n_pending_tasks is non-zero, then I have something to do after she is done And I shall wait for `wait_interval` seconds (with random jitter). This adds the following configuration options: - worker-keep-alive [boolean] - worker-wait-interval [int]
OH YEA travis passed. I was wondering what the errors were about. |
LGTM. Happy to merge unless anyone objects. I'll let it sit here for a day or two to give other people a chance |
Merge? |
Let worker wait for tasks running on other workers to complete.
Did this ever make it's way into the documentation? I see that it's referenced in a couple of places, but I didn't see an entry in the |
@duckontheweb it's in the |
It seems like the worker code here is getting that config from the |
The legacy method was to provide the So to be verbose in this example, you could provide
or
|
Perfect, thanks for clarifying that for me! |
See #222 and #223.