8000 Infinite loop when writing to a pipe closed on the other end · Issue #6 · recoilphp/react · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Infinite loop when writing to a pipe closed on the other end #6
Closed
@tsufeki

Description

@tsufeki

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0