3 ms·
I think you’re correct. Your file descriptor may represent an end of a pipe, which in turn is backed by a buffer of limited size. Ruby’s I/O API specifically wa
by Hackbraten 11mo ago
I think you’re correct. Your file descriptor may represent an end of a pipe, which in turn is backed by a buffer of limited size. Ruby’s I/O API specifically warns that reading lop-sidedly from e.g. stdout and stderr without `select`ing is dangerous [0].
I’ve experienced deadlocks in well-known programs, because developers who were unaware of this issue did a synchronous round-robin loop over stdout and stderr. [1]
[0]: https://docs.ruby-lang.org/en/master/Open3.html#method-c-popen3 https://docs.ruby-lang.org/en/master/Open3.html#method-c-pop...
[1]: https://github.com/Homebrew/homebrew-cask/pull/21665 https://github.com/Homebrew/homebrew-cask/pull/21665
- deleted 11mo ago[deleted]