9ee2243bed (master): Fiber scheduler: invoke `#io_write` hook on IO flush (#15609)

0 views
Skip to first unread message

Sharon Rosner

unread,
5:58 AM (18 hours ago) 5:58 AM
to ruby...@g.ruby-lang.org
Sharon Rosner 2025-12-19 10:58:26 +0000 (Fri, 19 Dec 2025)

New Revision: 9ee2243bed

https://github.com/ruby/ruby/commit/9ee2243bed

Log:
Fiber scheduler: invoke `#io_write` hook on IO flush (#15609)

Previously, calling IO#flush or closing an IO with unflushed buffered
writes would just invoke `#blocking_operation_wait` and flush the write
buffer using a `write` syscall. This change adds flushing through the
fiber scheduler by invoking the `#io_write` hook.

* Prefer IO::Buffer#write in IOScheduler

* Use Dir.tmpdir for test file

* Correctly handle errors in io_flush_buffer_fiber_scheduler

Modified files:
io.c
test/fiber/scheduler.rb
test/fiber/test_scheduler.rb
Reply all
Reply to author
Forward
0 new messages