Repository navigation
Wait for children uninterruptibly when an interrupted fiber exits - #10585
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 4794359 The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
This branch is waiting to be deployed
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.
Type
Description
Preserve an interrupted fiber’s computed exit, including finalizer defects, while waiting for its children to finish.
FiberImpl.evaluatesetsthis.interruptible = falsebefore evaluating the terminal child-shutdown wait. This is a non-restoring lifecycle transition: user computation and its finalizers have already finished, and the runtime must finish child cleanup before publishing the saved exit.In the reported reproduction, an uninterruptible child makes the child wait suspend. The wait’s async-finalizer continuation restores interruptibility, re-delivering the pending interruption and bypassing the continuation carrying the saved exit. A normal
uninterruptible(...)wrapper is not equivalent because it restores interruptibility afterward. The terminal transition avoids that restoration and prevents subsequent interrupts from replacing the cleanup computation.Validation
One regression in
packages/effect/test/Fiber.test.tsstarts the parent immediately, then interrupts it. Its finalizer forks a scheduled uninterruptible child and dies. The test checks that the resulting exit retains both interruption and the specific"boom"defect.Exit.findDefectassertion fails; the other 13 Fiber tests pass.nix develop -c pnpm lint-fixpasses.nix develop -c pnpm checkpasses.Implementation and independent runtime review are complete; the review found no changes required. The Fiber, Effect, Scope, and Scheduler suites passed all 381 tests on the reviewed implementation.
The Architect simplification pass at
47943595b0changes only the source comment, regression assertion/title, and changeset wording, with no runtime behavior change. Red/green, lint, and type checks were repeated on that head. A focused review of this cleanup delta is pending.Related
Closes #10584
Closes EFF-3706