Skip to content

Commit

Permalink
Merge pull request #496 from JamesWrigley/streaming-fixes
Browse files Browse the repository at this point in the history
Streaming branch fixes
  • Loading branch information
jpsamaroo authored Apr 11, 2024
2 parents 5381435 + 3b0a355 commit 8423fb8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/sch/Sch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,15 @@ function cleanup_proc(state, p, log_sink)

# If the worker process is still alive, clean it up
if wid in workers()
remotecall_wait(_cleanup_proc, wid, state.uid, log_sink)
try
remotecall_wait(_cleanup_proc, wid, state.uid, log_sink)
catch ex
# We allow ProcessExitedException's, which means that the worker
# shutdown halfway through cleanup.
if !(ex isa ProcessExitedException)
rethrow()
end
end
end

timespan_finish(ctx, :cleanup_proc, (;worker=wid), nothing)
Expand Down
13 changes: 11 additions & 2 deletions src/sch/dynamic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@ function safepoint(state)
if state.halt.set
# Force dynamic thunks and listeners to terminate
for (inp_chan,out_chan) in values(state.worker_chans)
close(inp_chan)
close(out_chan)
# Closing these channels will fail if the worker died, which we
# allow.
try
close(inp_chan)
close(out_chan)
catch ex
if !(ex isa ProcessExitedException)
rethrow()
end
end
end

# Throw out of scheduler
throw(SchedulerHaltedException())
end
Expand Down
2 changes: 1 addition & 1 deletion src/sch/eager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const EAGER_STATE = Ref{Union{ComputeState,Nothing}}(nothing)

function eager_context()
if EAGER_CONTEXT[] === nothing
EAGER_CONTEXT[] = Context([myid(),workers()...])
EAGER_CONTEXT[] = Context(procs())
end
return EAGER_CONTEXT[]
end
Expand Down

0 comments on commit 8423fb8

Please sign in to comment.