Skip to content

Fiber#raise: transfer into transferred fibers instead of resuming - #9734

Open
sampokuokkanen wants to merge 1 commit into
jruby:masterfrom
sampokuokkanen:fiber-raise-transferring
Open

sampokuokkanen wants to merge 1 commit into
jruby:masterfrom
sampokuokkanen:fiber-raise-transferring

Conversation

@sampokuokkanen

Copy link
Copy Markdown
Contributor

Fiber#raise always resumed the target, so a fiber suspended by transfer became "resumed" by the raiser. When it rescued the exception and transferred back, the raiser was marked as resuming and the transfer failed with "attempt to transfer to a resuming fiber".

Follow MRI's fiber_raise: forward to the fiber being resumed if there is one, transfer to a fiber suspended by transfer, and only resume a fiber parked in Fiber.yield.

io-event's Select selector hits this when cancelling an io_read with Fiber#raise. One step closer to getting io-event working.

Fiber#raise always resumed the target, so a fiber suspended by transfer
became "resumed" by the raiser. When it rescued the exception and
transferred back, the raiser was marked as resuming and the transfer
failed with "attempt to transfer to a resuming fiber".

Follow MRI's fiber_raise: forward to the fiber being resumed if there
is one, transfer to a fiber suspended by transfer, and only resume a
fiber parked in Fiber.yield.

io-event's Select selector hits this when cancelling an io_read with
Fiber#raise.
@sampokuokkanen sampokuokkanen changed the title Raise into a transferring fiber by transferring to it Fiber#raise: transfer into transferred fibers instead of resuming Sep 25, 2026
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.

1 participant