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
First stab at adding dynamic requires() #255
Conversation
oops meant the new state is "suspended" |
Some notes:
|
comments...plz :( |
I meant to +1 on this since I saw this PR, sorry - I remember the ML discussion about this. The only thing I'd miss would be the separation of |
Yeah it could potentially be a bit confusing with two different ways to specify the requirements... but in most cases it's probably nice to use requires() when you can, just for the reason you mentioned |
What's up with the CI error? Same "random" error as we've seen before? |
I think it was passing the tests earlier right? Btw can anyone take a look at this PR? I don't want it to be sitting here forever |
@@ -175,6 +175,10 @@ def add_task(self, worker, task_id, status=PENDING, runnable=True, deps=None, ex | |||
if deps is not None: | |||
task.deps = set(deps) | |||
|
|||
if new_deps is not None: |
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.
The default value of new_deps is [], not None, is this intended?
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.
fixed
This has great potential! I added some inline comments. There are a couple of gotchas I've been thinking about and I'm not sure if they are addressed:
|
I might try to refactor this to avoid the "suspended" state and just keep the "running" state instead. Then what would be nice is if we can do this across workers and not just do it on the same worker. I might add another mechanism to enforce "local" execution of dependencies later since we rely on it for a bunch of stuff (this would also replace the clunky delegates decorator) |
- Scheduler now handles a new state "pending" - Some funky code in the worker to halt execution and resume later - Might needs more testing - Put together somewhere over Greenland :) TODO: there are still some bugs when running with multiple workers, I'm investigating it
Old stuff, will abandon. Definitely planning to resubmit this one though |
TODO: there are still some bugs when running with multiple workers, I'm investigating it