Remove fiber scheduler and set fiber to blocking in forked process#15385
Merged
ioquatix merged 4 commits intoruby:masterfrom Dec 5, 2025
Merged
Remove fiber scheduler and set fiber to blocking in forked process#15385ioquatix merged 4 commits intoruby:masterfrom
ioquatix merged 4 commits intoruby:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
7b4457c to
67d3e2f
Compare
67d3e2f to
3cf8cd9
Compare
ioquatix
reviewed
Dec 4, 2025
ioquatix
reviewed
Dec 5, 2025
ioquatix
reviewed
Dec 5, 2025
4e3194f to
bf96764
Compare
bf96764 to
4fc796f
Compare
Member
|
Thanks, this looks good to me. In addition, do we need to do something for |
Contributor
Author
Seems to behave correctly: $ ruby -e "class C; def respond_to?(sym)=true; end; Fiber.set_scheduler(C.new); f = Fiber.new(blocking: false) { Process.daemon(true, true); p(scheduler: Fiber.scheduler, blocking: f.blocking?) }; f.resume"
$ {scheduler: nil, blocking: true} |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://bugs.ruby-lang.org/issues/21717
This PR is an alternative to #15342. In a forked process:
th->blockingto 1 to reflect single blocking fiber.I think this behavior is better as it removes the problem of scheduler state leaking into the forked process. It also prevents unexpected behavior in the forked process if forked from a non-blocking fiber.
See also #15354.
cc @ioquatix