Skip to content

Fix io_uring IO hooks for scheduler interface v4 - #213

Merged
samuel-williams-shopify merged 3 commits into
mainfrom
fix-ruby-head-v4-io
Aug 26, 2026
Merged

Fix io_uring IO hooks for scheduler interface v4#213
samuel-williams-shopify merged 3 commits into
mainfrom
fix-ruby-head-v4-io

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Ruby scheduler interface v4 changed the IO hook argument order and made each hook a single-operation primitive. The io_uring backend was still being tested and driven as though it should return EAGAIN from the event-loop fiber, which caused the ruby-head failures introduced by ruby/ruby#18483.

This change:

  • attempts one non-blocking syscall first and returns immediately when it completes;
  • submits one read or write SQE and suspends the calling child fiber only after EAGAIN/EWOULDBLOCK;
  • defers SQE submission so operations can be batched by the event loop;
  • uses the new locked IO::Buffer callbacks so kernel operations cannot outlive their buffers;
  • waits for an interrupted operation to complete or cancel before releasing its buffer lock;
  • keeps completion records alive until both operation and cancellation CQEs are observed; and
  • updates scheduler-interface-v4 tests to run genuinely suspending hooks from child fibers while preserving legacy-interface behavior.

Validation:

  • dedicated URing benchmark passes on Ubuntu with ruby-head
  • ruby-head test job passes on Ubuntu
  • 289 local tests pass, with 15 platform skips and 910 assertions
  • RuboCop and git diff --check pass

The coverage failure is also present on main; the JRuby failure is an unrelated unsupported-fork failure.

@samuel-williams-shopify
samuel-williams-shopify marked this pull request as ready for review August 26, 2026 01:38
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.

1 participant