-
-
Notifications
You must be signed in to change notification settings - Fork 624
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
Stuck in deadlock with up-to-date "run once" task #715
Comments
When you say deadlock, you mean task is sitting there trying to do something, but nothing is happening? |
Something like that, yes. In the second run above, it just sits there forever and nothing happens. |
+1, seeing this as well on Linux in version v3.13.0. Workaround for me seems to be to avoid using |
I believe I've found the deadlock. When the second execution of a Task needs to be skipped because it has already run (or is currently running), the code holds onto an execution slot while it waits for the first execution of the task to complete. If the first execution of the task has already completed, this wait immediately completes, and the execution slot is also immediately freed. If the first execution of the task is running its dependencies, it has temporarily released its execution slot to allow the dependencies to be run. Once those are complete, it attempts to reacquire an execution slot before running the commands for the task. If there is only one execution slot, this gets blocked because the only slot is held by the second execution of the task. |
Example Taskfile showing the issue
I have a quite large project where I manage to end up in a deadlock every time I try to run task. It seems to be related to a
run: once
task that other tasks depend on. This happens when I run with-C X
where X < 4 in my case. I suspect that If I add more "apps" I will eventually end up in this situation when running with all my cores as well.I've managed to condense my layout into this:
Running this example ends up in deadlock about one in ten times I run it (my larger repo ends up in deadlock every time, as I mentioned). I'm pretty sure it has to do with timing.
Example of a successful run:
And with deadlock:
The text was updated successfully, but these errors were encountered: