Issue #22424 has been reported by rhenium (Kazuki Yamaguchi). ---------------------------------------- Bug #22424: IO#readpartial and IO#sysread should respect IO#timeout= value https://bugs.ruby-lang.org/issues/22424 * Author: rhenium (Kazuki Yamaguchi) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- I expected `IO#readpartial` and `IO#sysread` to respect `IO#timeout=` and raise `IO::TimeoutError`, but they currently ignore it and block indefinitely: ```ruby IO.pipe{|r,w|r.timeout=1; r.read(1)} # raises IO::TimeoutError after 1 second, as expected IO.pipe{|r,w|r.timeout=1; r.gets(1)} # raises IO::TimeoutError after 1 second, as expected IO.pipe{|r,w|r.timeout=1; r.sysread(1)} # blocks indefinitely IO.pipe{|r,w|r.timeout=1; r.readpartial(1)} # blocks indefinitely ``` This appears to be a simple omission in commit:e4f91bbdbaa6ab3125f24967414ac5300bb244f5 (the original commit that added `IO#timeout=`, [Feature #18630]). -- https://bugs.ruby-lang.org/