Tasks which are obviously root tasks not considered `rootish`
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 778
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 3
Description
If a task does not have dependencies, it's obviously a root task.
However, `is_rootish` currently requires that the task also have > `2 * total_nthreads` other tasks in its TaskGroup. (The 2x is its own problem: https://github.com/dask/distributed/issues/7273.)
This means some tasks which are clearly root tasks don't go down root-task code paths.
The consequences of this aren't obvious. They may not be particularly noticeable as a user. See https://github.com/dask/distributed/pull/7221#issuecomment-1297605957 for discussion of practical implications. My main concern so far is that this could be hiding untested and possibly incorrect behavior. (So there _might_ be practical implications, we just haven't noticed them yet.)
1. Many of our tests don't use root-task code paths, even when queuing is enabled, because they don't submit enough tasks. So whatever situations they're testing for (which presumably could happen with more tasks too) are un-tested with queuing on. At least 12 tests fail with queuing on when this problem is fixed; we don't know how many pass in both cases, but were not using the queuing code path and would not have caught a regression.
2. More codepaths make reasoning harder. Combined with the fact that not all tests may be running, it's harder to avoid incorrect behavior at edge cases. Specifically, the round-robin code path doesn't get much explicit testing, is something we've already wanted to remove https://github.com/dask/distributed/pull/6974, and does not interact well with worker-saturation https://github.com/dask/distributed/issues/7197 — something CI didn't show until we tried changing the default.
Contributor guide
Assessment
This issue has not been assessed yet.