Skip to content

Capture selector wait errors immediately - #206

Merged
samuel-williams-shopify merged 3 commits into
mainfrom
fix/capture-selector-errno
Jul 27, 2026
Merged

Capture selector wait errors immediately#206
samuel-williams-shopify merged 3 commits into
mainfrom
fix/capture-selector-errno

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

Summary

  • capture errno in the EPoll and KQueue callback immediately after epoll_pwait2 / epoll_wait / kevent
  • seed skipped callbacks with EINTR, so they cannot consume ambient thread-local errno
  • raise from the captured error after returning through Ruby
  • extend the pending-interrupt regression coverage by seeding an unrelated ENOENT before selection

Closes #205.

Tests

  • Ruby 4.0.5/Linux EPoll: focused interruptable selector tests (6 passed, 10 assertions)
  • Ruby 4.0.6/macOS KQueue: focused interruptable selector tests (6 passed, 10 assertions)
  • Ruby 4.0.6/macOS: full suite (279 passed, 9 skipped, 901 assertions)

Assisted-By: devx/cb006b62-cf7a-4032-ae65-b8d1f2f1c264
Assisted-By: devx/cb006b62-cf7a-4032-ae65-b8d1f2f1c264
Assisted-By: devx/cb006b62-cf7a-4032-ae65-b8d1f2f1c264
@samuel-williams-shopify
samuel-williams-shopify merged commit 12e5cf0 into main Jul 27, 2026
56 of 60 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the fix/capture-selector-errno branch July 27, 2026 22:47
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.

Stale errno can produce a spurious Errno::* from select_internal_without_gvl (EPoll/KQueue)

1 participant