Skip to content

Add specs for Fiber.current_scheduler after a Fiber terminates - #1390

Merged
ioquatix merged 1 commit into
ruby:masterfrom
sampokuokkanen:fiber-current-scheduler-exit-specs
Aug 25, 2026
Merged

Add specs for Fiber.current_scheduler after a Fiber terminates#1390
ioquatix merged 1 commit into
ruby:masterfrom
sampokuokkanen:fiber-current-scheduler-exit-specs

Conversation

@sampokuokkanen

Copy link
Copy Markdown
Contributor

The existing examples all check what a Fiber sees while it is running, so nothing covered the root Fiber once a blocking Fiber has gone away. Cover normal completion, an exception propagating out of resume, and Fiber#kill.

The existing examples all check what a Fiber sees while it is running, so nothing covered the root Fiber once a blocking Fiber has gone away. Cover normal completion, an exception propagating out of resume, and Fiber#kill.
@ioquatix
ioquatix merged commit b4d5211 into ruby:master Aug 25, 2026
14 checks passed
sampokuokkanen added a commit to sampokuokkanen/jruby that referenced this pull request Aug 26, 2026
Fiber.current_scheduler reads the Thread's blocking count, and it drifted both ways: Fiber#resume decremented a target that exchangeWithFiber had already decremented, and the hand-back was counted twice. Account like MRI's fiber_switch instead, where each Fiber adjusts only for itself.

Adds core/fiber/current_scheduler_spec.rb from ruby/spec#1388 and drops the tag added in jruby#9604. Also adds additional root Fiber specs from ruby/spec#1390.
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.

2 participants