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
delay creation of tasks until after another task is executed #14
Comments
Parallel processing seems to work fine with threads, it only fails with processes. As far as I understood, the problem is that the updated (Which can result in another problem: if |
I guess using shared memory to store (Maybe it would also be better to refactor |
I updated my branch. Only problem left is multiprocessing... I just figured out what to do :) Actually the main process sends the task to the executing process, but it sends an incomplete task without So I will change the code to send the full task in case it is late created task and if has a closure give an error. So closures will be forbidden only in this specific case... |
Aren't most tasks in nikola using closures (such as in |
Please only forbid closures when using processes and not threads. After all, there they work fine :) |
@schettino72: is it possible to create another delayed task during delayed task generation? Delayed task creation wants me to return dicts, and it seems I cannot return a |
@felixfontein ok. I will add support for that... please check 4e32bd3 note that the semantics of creating a task directly is not the same as passing dicts (mainly regarding to task_dep and group_task) when i have time a create a proper patch and merge this. |
It still doesn't work. I think the reason is this line:
seems to work better. |
With that change, I still have a problem: I get an exception in line 103 of runner.py, when doit tries to access |
I don't have time to debug this further right now, I'll try again tomorrow... |
Ok, I think I found the source -- though I don't yet know how to fix it. The problem seems that the node for the task creating more tasks is destroyed, while it contains information which nodes are waiting for it. This information seems to not be recovered anywhere and gets lost, whence the nodes waiting for the task generation wait forever. |
@felixfontein i will take a look in your example... |
Are you using doit what is the problem with it? is there any missing task. i still didnt follow the logic of your example... |
yes if a task uses |
And you should revert your change that sets the |
I was using the create-task-instance branch. And without the change, only some tasks are executed since half of them aren't generated. The proper output should be:
(I never got further than |
thanks. i am taking a look... |
I got a fix :) your example works for me now... |
Cool! Works great now :) I also added code (remotely) similar to |
The only thing which isn't working at the moment is specifying default tasks. If I add
(or similar) in case |
@felixfontein
When I first implemented this feature I didnt think people would use it to create completely dynamic tasks, now it can... but I would recommend you to always use "empty hull" for tasks. I dont know how to solve your problem other that creating an empty hull. |
All changes are now merged into master. Please use I am ready to make a new release but I will wait for further feedback from you... |
Thanks a lot for implementing that feature and merging it into master! I'll try to find out what precisely is needed in Nikola and how I can implement that. That'll take a bit of time (in particular because I don't have too much spare time at the moment), but if I find something on the way I'll tell you :) |
This is required when loading dodo.py you dont have enough information to create some of your tasks metadata. see: getnikola/nikola#1562
WIP branch: https://github.com/pydoit/doit/tree/delayed-task-creation
Sample testing code: https://gist.github.com/schettino72/9868c27526a6c5ea554c
TODO:
run
commandlist
,clean
, etc create all tasksThe text was updated successfully, but these errors were encountered: