Skip to content

Commit

Permalink
Properly close stdin for Distributed workers
Browse files Browse the repository at this point in the history
This should fix the issues seen when bumping `Pkg` in
#44828
  • Loading branch information
staticfloat committed Apr 4, 2022
1 parent 87f9af4 commit 670fa13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stdlib/Distributed/src/cluster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ start_worker(cookie::AbstractString=readline(stdin); kwargs...) = start_worker(s
function start_worker(out::IO, cookie::AbstractString=readline(stdin); close_stdin::Bool=true, stderr_to_stdout::Bool=true)
init_multi()

close_stdin && close(stdin) # workers will not use it
if close_stdin # workers will not use it
redirect_stdin(devnull)
close(stdin)
end
stderr_to_stdout && redirect_stderr(stdout)

init_worker(cookie)
Expand Down

0 comments on commit 670fa13

Please sign in to comment.