Skip to content

Commit 42bd36f

Browse files
committed
checkpoint: Use at-invokelatest
1 parent 0107b31 commit 42bd36f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sch/Sch.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import MemPool: DRef, StorageResource
66
import MemPool: poolset, storage_available, storage_capacity, storage_utilized, externally_varying
77
import Statistics: mean
88
import Random: randperm
9+
import Base: @invokelatest
910

1011
import ..Dagger
1112
import ..Dagger: Context, Processor, Thunk, WeakThunk, ThunkFuture, ThunkFailedException, Chunk, WeakChunk, OSProc, AnyScope
@@ -527,7 +528,7 @@ function scheduler_run(ctx, state::ComputeState, d::Thunk, options)
527528
state.errored[node] = thunk_failed
528529
if node.options !== nothing && node.options.checkpoint !== nothing
529530
try
530-
node.options.checkpoint(node, res)
531+
@invokelatest node.options.checkpoint(node, res)
531532
catch err
532533
report_catch_error(err, "Thunk checkpoint failed")
533534
end
@@ -892,7 +893,7 @@ function fire_tasks!(ctx, thunks::Vector{<:Tuple}, (gproc, proc), state)
892893
end
893894
if thunk.options !== nothing && thunk.options.restore !== nothing
894895
try
895-
result = thunk.options.restore(thunk)
896+
result = @invokelatest thunk.options.restore(thunk)
896897
if result isa Chunk
897898
state.cache[thunk] = result
898899
state.errored[thunk] = false

0 commit comments

Comments
 (0)