Skip to content
Commit 64ff603c authored by Ryan Roberts's avatar Ryan Roberts
Browse files

Build: Fix "ValueError: I/O operation on closed file"



Very occasionally, a build would fail with the above error. The root
cause was that neither of the output streams for a process would be
unregistered from the selector until both had reported EOF. This means
that one of them could be requeued after it reported EOF, while the
second was handled and (and the first unregistered/closed as a result).
Then we would get around to handling the first one from the queue and
bang.

Solve this by unregistering the stream from the selector as soon as it
reports EOF. Acomplish by refactoring _proc_deactivate() into
_proc_stream_deactivate() + _proc_deactivate(). And also simplify some
process shutdown code since popen is doing all the stream close() calls
for us (proven with trace).

Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
parent bfd07fdd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment