Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circumvent pipe buffer deadlock #166

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/ambiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,11 @@ function _find_ambiguities(
end
cmd = `$cmd --startup-file=no -e $code`

out = Pipe()
err = Pipe()
outfile, out = mktemp(; cleanup = false)
lgoettgens marked this conversation as resolved.
Show resolved Hide resolved
errfile, err = mktemp(; cleanup = false)
lgoettgens marked this conversation as resolved.
Show resolved Hide resolved
succ = success(pipeline(cmd; stdout = out, stderr = err))
close(out.in)
close(err.in)
strout = String(read(out))
strerr = String(read(err))
strout = read(outfile, String)
strerr = read(errfile, String)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we rm(outfile) and rm(errfile)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok we can also just leave it as is, fine by me.

num_ambiguities = if succ
0
else
Expand Down
Loading