Skip to content

Fiber scheduler: invoke #io_write hook on IO flush#15609

Merged
ioquatix merged 4 commits intoruby:masterfrom
noteflakes:io_flush_fiber_scheduler
Dec 19, 2025
Merged

Fiber scheduler: invoke #io_write hook on IO flush#15609
ioquatix merged 4 commits intoruby:masterfrom
noteflakes:io_flush_fiber_scheduler

Conversation

@noteflakes
Copy link
Copy Markdown
Contributor

@noteflakes noteflakes commented Dec 17, 2025

https://bugs.ruby-lang.org/issues/21789

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.

cc @ioquatix

@launchable-app
Copy link
Copy Markdown

launchable-app Bot commented Dec 17, 2025

1/67066 Tests Failed

test/ruby/test_gc.rb#test_stat
Failure:
TestGc#test_stat [/Users/runner/work/ruby/ruby/src/test/ruby/test_gc.rb:178]:
<60940> expected but was
<60659>.

[-> View Test suite health in main branch]

@noteflakes noteflakes marked this pull request as ready for review December 17, 2025 11:02
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.
@ioquatix ioquatix force-pushed the io_flush_fiber_scheduler branch from 028ac76 to 04b4808 Compare December 19, 2025 09:19
@ioquatix ioquatix merged commit 9ee2243 into ruby:master Dec 19, 2025
98 of 103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants