Skip to content

[pull] master from ruby:master - #1382

Merged
pull[bot] merged 4 commits into
turkdevops:masterfrom
ruby:master
Sep 6, 2026
Merged

[pull] master from ruby:master#1382
pull[bot] merged 4 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Sep 6, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

byroot and others added 4 commits September 6, 2026 09:22
When lchmod isn't available, it raises NotImplementedError.
Before parking a thread on an fd, the M:N scheduler polls it once to see
whether it is ready already, and counts any answer poll gives as
readiness.  poll answers POLLNVAL for a closed fd, so the wait reported
the event its caller asked for: IO#wait_writable on a closed fd returned
the IO instead of raising Errno::EBADF, where a thread on a dedicated
native thread raises it from the POLLNVAL its own poll returns.

The probe has read POLLNVAL as readiness since the M:N scheduler was
added, but it was harmless while rb_thread_wait_for_single_fd polled
regardless and only asked the scheduler whether to retry.  Since
41dd159 a scheduler that reports readiness skips the poll and fills
in the requested events, so the POLLNVAL that becomes EBADF below is
never seen.  Ruby 3.3 raises it; 3.4 and later do not.

Report readiness only for an actual event.  A closed fd then goes on to
the registration, which the backend also refuses for it (EBADF), and
from there to the blocking path, whose poll reports it as before.

The test covers it from a Ractor, whose threads use the M:N scheduler
whatever RUBY_MN_THREADS says.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Sep 6, 2026
@pull pull Bot added the ⤵️ pull label Sep 6, 2026
@pull
pull Bot merged commit e536482 into turkdevops:master Sep 6, 2026
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants