Skip to content

Clarify Effect interruption, cleanup, and fork guarantees - #10683

Merged
tim-smart merged 6 commits into
mainfrom
agent/effect-bot/a2e09802f727
Nov 17, 2026
Merged

tim-smart merged 6 commits into
mainfrom
agent/effect-bot/a2e09802f727

Conversation

@effect-bot

Copy link
Copy Markdown
Contributor

Summary

Clarifies the API-specific runtime guarantees requested in #10667, without changing runtime behavior or public signatures.

  • Documents thrown thunks only for Effect.suspend, not a universal callback rule.
  • Explains acquireUseRelease interruptibility and the interrupted Exit supplied to release.
  • Separates observation cancellation from existing parent/child ownership.
  • Documents cleanup waiting for races, timeout variants, and concurrent all/forEach, including uninterruptible delays. Explicitly distinguishes fiber cleanup from cancellation of underlying external work and excludes detached fibers.
  • Clarifies scope/container ownership, interruption-safe registration, and the self-closing-scope exception. Replacement in FiberMap/FiberHandle does not await the previous fiber’s cleanup.
  • Explains deferred versus immediate startup and default/true/inherited interruptibility, including explicit interruptible regions. Updates migration/forking.md without promising a scheduler turn.

Review guide

  1. 9443a0f2bc: focused, Deferred-coordinated regression coverage in five existing suites (tests-only pass).
  2. Documentation commit: JSDoc in Effect, Fiber, FiberSet, FiberMap, FiberHandle, plus the hand-maintained forking migration guide. Existing runnable examples are unchanged.

The general callback-throw rule, inconsistent closed-container run behavior, loser interruption timing, and cleanup-failure aggregation are intentionally not broadened into guarantees. The onWinner thrown-callback inconsistency remains a separate runtime issue. Website updates outside this repository are not included.

Validation

All commands run through nix develop -c:

  • pnpm jsdocs --check
  • pnpm lint-fix and pnpm lint
  • pnpm check
  • Targeted pnpm test --run for Effect, Fiber, FiberSet, FiberMap, and FiberHandle: 428 tests passed
  • git diff --check

No changeset: this PR adds regression coverage and documents existing behavior; runtime code, exported signatures, and examples are unchanged.

Closes #10667
Closes EFF-3839

@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c3b188b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@effect-janitor effect-janitor Bot added the 4.0 label Nov 16, 2026
Replace five copies of the registration-during-startup scenario with one helper, drive the cleanup matrix from a table, make each uninterruptible fork option row discriminate, and move the fork option and timeout tests beside their suites.
@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 40.09 KB 40.09 KB 0.00 KB (0.00%)
basic.ts 7.31 KB 7.31 KB 0.00 KB (0.00%)
batching.ts 11.21 KB 11.21 KB 0.00 KB (0.00%)
brand.ts 7.00 KB 7.00 KB 0.00 KB (0.00%)
cache.ts 11.73 KB 11.73 KB 0.00 KB (0.00%)
config.ts 23.09 KB 23.09 KB 0.00 KB (0.00%)
differ.ts 22.20 KB 22.20 KB 0.00 KB (0.00%)
http-client.ts 27.45 KB 27.45 KB 0.00 KB (0.00%)
http-router.ts 37.59 KB 37.59 KB 0.00 KB (0.00%)
logger.ts 12.19 KB 12.19 KB 0.00 KB (0.00%)
metric.ts 9.65 KB 9.65 KB 0.00 KB (0.00%)
optic.ts 7.21 KB 7.21 KB 0.00 KB (0.00%)
pubsub.ts 16.21 KB 16.21 KB 0.00 KB (0.00%)
queue.ts 13.09 KB 13.09 KB 0.00 KB (0.00%)
schedule.ts 11.99 KB 11.99 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.29 KB 14.29 KB 0.00 KB (0.00%)
schema-binary.ts 42.48 KB 42.48 KB 0.00 KB (0.00%)
schema-class.ts 21.96 KB 21.96 KB 0.00 KB (0.00%)
schema-codegen.ts 30.70 KB 30.70 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 30.56 KB 30.56 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 28.26 KB 28.26 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.54 KB 15.54 KB 0.00 KB (0.00%)
schema-string.ts 12.50 KB 12.50 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.43 KB 16.43 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 39.63 KB 39.63 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 21.11 KB 21.11 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.28 KB 21.28 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.37 KB 21.37 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.42 KB 26.42 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.45 KB 21.45 KB 0.00 KB (0.00%)
schema.ts 21.05 KB 21.05 KB 0.00 KB (0.00%)
stm.ts 14.46 KB 14.46 KB 0.00 KB (0.00%)
stream.ts 10.56 KB 10.56 KB 0.00 KB (0.00%)

@tim-smart
tim-smart enabled auto-merge (squash) November 17, 2026 03:07
@tim-smart
tim-smart merged commit b880497 into main Nov 17, 2026
18 checks passed
@tim-smart
tim-smart deleted the agent/effect-bot/a2e09802f727 branch November 17, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants