Skip to content

Commit

Permalink
fix _next_in_linear_chain
Browse files Browse the repository at this point in the history
could have traversed into widely-shared deps
  • Loading branch information
gjoseph92 committed Sep 30, 2022
1 parent d22174e commit 63274fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8296,15 +8296,15 @@ def _next_in_linear_chain(ts: TaskState, cutoff: int) -> TaskState | None:

# Check if this is part of a linear chain:
# exactly 1 dependency, excluding widely-shared tasks.
non_widely_shared = 0
next: TaskState | None = None
for dts in ts.dependencies:
if len(dts.dependents) > cutoff: # widely-shared; ignore it
continue
if non_widely_shared:
if next:
return None
non_widely_shared += 1
next = dts

return next(iter(ts.dependents))
return next


def family(
Expand Down

0 comments on commit 63274fa

Please sign in to comment.