Skip to content

Commit

Permalink
Merge pull request JuliaLang/julia#44789 from JuliaLang/backports-rel…
Browse files Browse the repository at this point in the history
…ease-1.8

Backports for 1.8-rc1
  • Loading branch information
KristofferC authored May 26, 2022
2 parents 6ed027c + 7648ddd commit 7f35b2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion 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
6 changes: 5 additions & 1 deletion test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,11 @@ cluster_cookie("")
for close_stdin in (true, false), stderr_to_stdout in (true, false)
local npids = addprocs_with_testenv(RetainStdioTester(close_stdin,stderr_to_stdout))
@test remotecall_fetch(myid, npids[1]) == npids[1]
@test close_stdin != remotecall_fetch(()->isopen(stdin), npids[1])
if close_stdin
@test remotecall_fetch(()->stdin === devnull && !isreadable(stdin), npids[1])
else
@test remotecall_fetch(()->stdin !== devnull && isopen(stdin) && isreadable(stdin), npids[1])
end
@test stderr_to_stdout == remotecall_fetch(()->(stderr === stdout), npids[1])
rmprocs(npids)
end
Expand Down

0 comments on commit 7f35b2e

Please sign in to comment.