Repository navigation
Sch: Propagate a failure to dependents before deleting the failed task - #763
Merged
jpsamaroo merged 1 commit intoOct 7, 2026
Merged
Conversation
Both failure paths (`finish_task!` and `set_failed!`) called
`delete_unused_task!` and only then `schedule_dependents!`. Each
dependent builds its own `DTaskFailedException` from the upstream error
with `load_result(state, origin)`. If nothing else referenced the
upstream task, the delete had just cleared its result, so `load_result`
hit
AssertionError: Thunk[1] is not yet finished
on the scheduler task, and the eager scheduler exited. Every task then in
flight failed with `SchedulingException (Scheduler exited)`.
This needs a failed task whose `DTask` is no longer referenced and that
still has dependents, which is what the intermediate tasks of a chain or
of a tree reduction are. Propagate first, then delete.
Member
|
Great catch, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #762.
finish_task!andset_failed!calleddelete_unused_task!and thenschedule_dependents!. Each dependent builds itsDTaskFailedExceptionfrom the upstream error withload_result(state, origin). When nothing else referenced the upstream task, the delete had already cleared its result,load_resultasserted, and the eager scheduler exited.This swaps the two calls in both places, so the result is deleted after the dependents have read it. The comment on
task_delete!described the old order, so I shortened it. Failure paths still do not recycle the thunk.The new test in
test/thunk.jlbuilds a chain where only the last task is referenced. On master it fails withSchedulingException (Scheduler exited).thunkandschedulerpass on Julia 1.10, 1.11 and 1.12.datadeps,task-queues,allocationsandmutationpass on 1.12. The broken tests inthunk(1) andscheduler(5) are the same ones as on master.The change only moves a call, so it adds no work and no allocation.