Skip to content

Commit d45f1d3

Browse files
committed
Sch/restore: Don't try to submit empty FireTaskSpec
1 parent de30887 commit d45f1d3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/sch/Sch.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -861,14 +861,16 @@ Base.hash(task::TaskSpec, h::UInt) = hash(task.thunk_id, hash(TaskSpec, h))
861861
sch_handle, state.uid))
862862
end
863863

864-
if Dagger.root_worker_id(gproc) == myid()
865-
@reusable_tasks :fire_tasks!_task_cache 32 _->nothing "fire_tasks!" FireTaskSpec(proc, state.chan, to_send)
866-
else
867-
# N.B. We don't batch these because we might get a deserialization
868-
# error due to something not being defined on the worker, and then we don't
869-
# know which task failed.
870-
for (idx, task_spec) in enumerate(to_send)
871-
@reusable_tasks :fire_tasks!_task_cache 32 _->nothing "fire_tasks!" FireTaskSpec(proc, state.chan, task_spec)
864+
if !isempty(to_send)
865+
if Dagger.root_worker_id(gproc) == myid()
866+
@reusable_tasks :fire_tasks!_task_cache 32 _->nothing "fire_tasks!" FireTaskSpec(proc, state.chan, to_send)
867+
else
868+
# N.B. We don't batch these because we might get a deserialization
869+
# error due to something not being defined on the worker, and then we don't
870+
# know which task failed.
871+
for task_spec in to_send
872+
@reusable_tasks :fire_tasks!_task_cache 32 _->nothing "fire_tasks!" FireTaskSpec(proc, state.chan, task_spec)
873+
end
872874
end
873875
end
874876
to_send_cleanup()

0 commit comments

Comments
 (0)