Closed
Description
On linux, using yield Recoil::write($pipe, $data)
when the other end of the pipe is closed (for example its process has exited) leads to an infinite loop in ReactApi::write()
.
I found that stream_select()
marks the stream as ready to write, but fwrite()
returns 0
(not false
), and no errors are thrown. See http://php.net/manual/en/function.fwrite.php#96951
I propose the solution taken by react/stream, i.e. check here for $bytes === 0
as well. stream_select()
indicates that it's possible to write at least one byte, so zero can only mean an error condition.
I think this applies to the reference kernel as well.
Thank you.