[pull] master from ruby:master - #1382
Merged
Merged
Conversation
[Bug #22292] This was a leftover 6f339ae
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )