Read from the error pipe in a separate thread
If the build process tries to write more bytes than will fit in the pipe buffer, it will block until the parent process does a read. However, the parent process will only do a read after the child process has exited or died, leading to a deadlock. Fix this by doing the read in a separate thread.
This commit is contained in:
parent
dfe1de7acd
commit
a6bf5fa2ba
@ -515,8 +515,9 @@ class FormulaInstaller
|
||||
|
||||
ignore_interrupts(:quietly) do # the child will receive the interrupt and marshal it back
|
||||
write.close
|
||||
thr = Thread.new { read.read }
|
||||
Process.wait(pid)
|
||||
data = read.read
|
||||
data = thr.value
|
||||
read.close
|
||||
raise Marshal.load(data) unless data.nil? or data.empty?
|
||||
raise Interrupt if $?.exitstatus == 130
|
||||
|
Loading…
x
Reference in New Issue
Block a user