Skip to content

Fix lost interruption and typed failure leaks when skipping handlers - #8652

Merged
tim-smart merged 5 commits into
mainfrom
fix/interrupted-uninterruptible-failure-8650
Oct 1, 2026
Merged

tim-smart merged 5 commits into
mainfrom
fix/interrupted-uninterruptible-failure-8650

Conversation

@mikearnaldi

@mikearnaldi mikearnaldi commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

When a fiber is interrupted while suspended in an uninterruptible region that later fails, the runtime skips surrounding recovery handlers but can leak the typed failure and lose the pending interruption. Preserve the interruption and defects, and strip typed failures when skipping those handlers, including when unwinding reaches an outer uninterruptible handler.

Keep recorded failures when no recovery handler is skipped, preserving existing concurrent traversal and child cleanup behavior. Move the existing cause-combining helper into the core module to avoid a circular runtime import.

Adds three regression tests: a skipped handler drops typed failures but keeps defects and the interruption; an uninterruptible handler past the skipped region observes an interrupt-only cause; and a handler inside the uninterruptible region still recovers. Also adds an effect patch changeset, and updates the existing subscription interruption assertion to expect an interrupt-only exit instead of a leaked typed completion signal.

Validation:

  • pnpm test --run packages/effect/test/Effect.test.ts packages/effect/test/SubscriptionRef.test.ts passed (299 tests).
  • pnpm check passed.
  • pnpm lint-fix passed.

Fixes #8650.
Closes EFF-1634

@changeset-bot

changeset-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5f78c3b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/openapi-generator Patch

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

@effect-janitor effect-janitor Bot added the 4.0 label Oct 1, 2026
@effect-janitor effect-janitor Bot added the bug Something isn't working label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026 •

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 38.75 KB 38.71 KB +0.04 KB (+0.10%)
basic.ts 6.93 KB 6.88 KB +0.05 KB (+0.73%)
batching.ts 10.01 KB 9.97 KB +0.04 KB (+0.37%)
brand.ts 6.72 KB 6.57 KB +0.15 KB (+2.27%)
cache.ts 10.71 KB 10.66 KB +0.05 KB (+0.47%)
config.ts 22.03 KB 21.98 KB +0.05 KB (+0.22%)
differ.ts 21.16 KB 21.12 KB +0.04 KB (+0.20%)
http-client.ts 22.13 KB 22.10 KB +0.03 KB (+0.14%)
http-router.ts 33.38 KB 33.35 KB +0.03 KB (+0.09%)
logger.ts 10.97 KB 10.92 KB +0.05 KB (+0.46%)
metric.ts 8.88 KB 8.83 KB +0.05 KB (+0.61%)
optic.ts 6.95 KB 6.80 KB +0.15 KB (+2.18%)
pubsub.ts 15.04 KB 15.00 KB +0.04 KB (+0.24%)
queue.ts 11.96 KB 11.91 KB +0.05 KB (+0.43%)
schedule.ts 11.07 KB 11.03 KB +0.04 KB (+0.33%)
schema-bigdecimal.ts 13.62 KB 13.58 KB +0.04 KB (+0.32%)
schema-binary.ts 39.78 KB 39.74 KB +0.04 KB (+0.10%)
schema-class.ts 20.90 KB 20.86 KB +0.04 KB (+0.22%)
schema-fromJsonSchemaDocument.ts 31.92 KB 31.88 KB +0.05 KB (+0.14%)
schema-representation-roundtrip.ts 27.09 KB 27.07 KB +0.02 KB (+0.07%)
schema-string-transformation.ts 14.37 KB 14.32 KB +0.04 KB (+0.31%)
schema-string.ts 11.87 KB 11.82 KB +0.05 KB (+0.41%)
schema-template-literal.ts 15.93 KB 15.89 KB +0.04 KB (+0.27%)
schema-toArbitrary.ts 38.28 KB 38.25 KB +0.03 KB (+0.09%)
schema-toCodeDocument.ts 25.14 KB 25.09 KB +0.04 KB (+0.17%)
schema-toCodecJson.ts 20.09 KB 20.05 KB +0.04 KB (+0.20%)
schema-toEquivalence.ts 20.28 KB 20.25 KB +0.04 KB (+0.18%)
schema-toFormatter.ts 20.39 KB 20.35 KB +0.04 KB (+0.20%)
schema-toJsonSchemaDocument.ts 24.86 KB 24.81 KB +0.05 KB (+0.20%)
schema-toRepresentation.ts 20.35 KB 20.31 KB +0.04 KB (+0.21%)
schema.ts 20.11 KB 20.06 KB +0.05 KB (+0.25%)
stm.ts 12.95 KB 12.91 KB +0.04 KB (+0.34%)
stream.ts 9.85 KB 9.82 KB +0.04 KB (+0.38%)

@mikearnaldi
mikearnaldi requested a review from tim-smart October 1, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interrupted fiber in uninterruptible block drops interrupt and leaks typed Fail past catch

2 participants