Repository navigation
Fix ClusterWorkflowEngine blocking shard release on pending resume interrupts - #10262
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: c77402e The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 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.
|
…gion A pending outside interrupt fires as soon as the interruptible region opens, so the Abandon annotation was never added and ensureSuccess kept retrying. Annotating first merges it into the pending cause, so the retry predicate and the entity manager see an abandonment and the handler exits with an interrupt instead of a defect. Reverts the ensureSuccess predicate change.
Merged
brandhaug
added a commit
to brandhaug/b2b-saas-starter
that referenced
this pull request
Nov 5, 2026
## pnpm-workspace.yaml (default) ## Dependency Updates | Package | From | To | Type | | --- | --- | --- | --- | | `@effect/platform-node` | 4.1.1 | 4.1.2 | patch | | `@effect/sql-d1` | 4.1.1 | 4.1.2 | patch | | `@effect/vitest` | 4.1.1 | 4.1.2 | patch | | `cn` | 0.5.1 | 0.5.2 | patch | | `effect` | 4.1.1 | 4.1.2 | patch | | `jose` | 6.2.14 | 6.2.15 | patch | ## Release Notes <details> <summary><b>@<!---->effect/platform-node</b> (4.1.1 → 4.1.2)</summary> ### Patch Changes - [#10237](Effect-TS/effect#10237) [`ee4f710`](Effect-TS/effect@ee4f710) Thanks @<!---->Hoishin! - Pin `@effect/platform-node-shared` to the exact version released with each platform package. - [#10257](Effect-TS/effect#10257) [`b0a1cee`](Effect-TS/effect@b0a1cee) Thanks @<!---->tim-smart! - Update repository dependencies to their latest compatible releases. - Updated dependencies [[`5216684`](Effect-TS/effect@5216684), [`b707ad1`](Effect-TS/effect@b707ad1), [`46f48af`](Effect-TS/effect@46f48af), [`92201bc`](Effect-TS/effect@92201bc), [`cf329f3`](Effect-TS/effect@cf329f3), [`1d25d78`](Effect-TS/effect@1d25d78), [`d190d97`](Effect-TS/effect@d190d97), [`d7b3b6b`](Effect-TS/effect@d7b3b6b), [`a478745`](Effect-TS/effect@a478745), [`69eaa29`](Effect-TS/effect@69eaa29), [`3711ba6`](Effect-TS/effect@3711ba6), [`715c5e4`](Effect-TS/effect@715c5e4), [`b0a1cee`](Effect-TS/effect@b0a1cee), [`2a10622`](Effect-TS/effect@2a10622), [`6bccdd5`](Effect-TS/effect@6bccdd54e1bc5d7f …[full notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.1.2) </details> <details> <summary><b>@<!---->effect/sql-d1</b> (4.1.1 → 4.1.2)</summary> ### Patch Changes - [#10257](Effect-TS/effect#10257) [`b0a1cee`](Effect-TS/effect@b0a1cee) Thanks @<!---->tim-smart! - Update repository dependencies to their latest compatible releases. - Updated dependencies [[`5216684`](Effect-TS/effect@5216684), [`b707ad1`](Effect-TS/effect@b707ad1), [`46f48af`](Effect-TS/effect@46f48af), [`92201bc`](Effect-TS/effect@92201bc), [`cf329f3`](Effect-TS/effect@cf329f3), [`1d25d78`](Effect-TS/effect@1d25d78), [`d190d97`](Effect-TS/effect@d190d97), [`d7b3b6b`](Effect-TS/effect@d7b3b6b), [`a478745`](Effect-TS/effect@a478745), [`69eaa29`](Effect-TS/effect@69eaa29), [`3711ba6`](Effect-TS/effect@3711ba6), [`715c5e4`](Effect-TS/effect@715c5e4), [`b0a1cee`](Effect-TS/effect@b0a1cee), [`2a10622`](Effect-TS/effect@2a10622), [`6bccdd5`](Effect-TS/effect@6bccdd5), [`60be011`](Effect-TS/effect@60be011), [`e1edcdc`](Effect-TS/effect@e1edcdc), [`ef81e9d`](https://github.com/Effect-TS/effec …[full notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/sql-d1%404.1.2) </details> <details> <summary><b>@<!---->effect/vitest</b> (4.1.1 → 4.1.2)</summary> ### Patch Changes - Updated dependencies [[`5216684`](Effect-TS/effect@5216684), [`b707ad1`](Effect-TS/effect@b707ad1), [`46f48af`](Effect-TS/effect@46f48af), [`92201bc`](Effect-TS/effect@92201bc), [`cf329f3`](Effect-TS/effect@cf329f3), [`1d25d78`](Effect-TS/effect@1d25d78), [`d190d97`](Effect-TS/effect@d190d97), [`d7b3b6b`](Effect-TS/effect@d7b3b6b), [`a478745`](Effect-TS/effect@a478745), [`69eaa29`](Effect-TS/effect@69eaa29), [`3711ba6`](Effect-TS/effect@3711ba6), [`715c5e4`](Effect-TS/effect@715c5e4), [`b0a1cee`](Effect-TS/effect@b0a1cee), [`2a10622`](Effect-TS/effect@2a10622), [`6bccdd5`](Effect-TS/effect@6bccdd5), [`60be011`](Effect-TS/effect@60be011), [`e1edcdc`](Effect-TS/effect@e1edcdc), [`ef81e9d`](Effect-TS/effect@ef81e9d), [`013fb34`](Effect-TS/effect@013fb34), [`113dbc7`](Effect-TS/effect@113dbc7 …[full notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/vitest%404.1.2) </details> <details> <summary><b>cn</b> (0.5.1 → 0.5.2)</summary> ### Patch Changes - [#162](shadcn-ui/cn#162) [`b8c5a1b`](shadcn-ui/cn@b8c5a1b) Thanks [@<!---->nonhana](https://github.com/nonhana)! - Export `CnFunction`, `Engine`, and `ClassNameValue` from `cn/config`, and those plus `ClassValue` from `cn/engine`. Exporting an inferred `createCn()` result (`export const cn = createCn({ ... })`) no longer fails with TS2742 or TS2883 in projects that emit declarations. - [#167](shadcn-ui/cn#167) [`6ebb4ce`](shadcn-ui/cn@6ebb4ce) Thanks [@<!---->RaphaelFakhri](https://github.com/RaphaelFakhri)! - `cn build` keeps numeric spacing such as `p-4` when a stylesheet declares `--spacing` after a `--*: initial` or `--spacing-*: initial` reset, and keeps `p-px` through the reset, as Tailwind does. - [#160](shadcn-ui/cn#160) [`a805c68`](shadcn-ui/cn@a805c68) Thanks [@<!---->mehimanshupatil](https://github.com/mehimanshupatil)! - `createCn`, `createTwMerge`, and `extendTailwindMerge` from `cn/config` accept optional type arguments for custom class-group and theme ids, like tailwind-merge's `extendTailwindMerge<ClassGroupIds, ThemeGroupIds>`. With them, unknown group keys and conflict ids are type errors. Without them, any id is still accepted. </details> <details> <summary><b>effect</b> (4.1.1 → 4.1.2)</summary> ### Patch Changes - [#10217](Effect-TS/effect#10217) [`5216684`](Effect-TS/effect@5216684) Thanks @<!---->devangpratap! - Fix `ByteSize` decimal unit constructors such as `megabytes(2.01)` throwing or returning the wrong byte count, and reject fractional-byte quantities instead of rounding them. - [#10261](Effect-TS/effect#10261) [`b707ad1`](Effect-TS/effect@b707ad1) Thanks @<!---->effect-bot! - Fix cluster entity defect restart backoff being shared by all entities of a type and never resetting. - [#10249](Effect-TS/effect#10249) [`46f48af`](Effect-TS/effect@46f48af) Thanks @<!---->effect-bot! - Prevent an interrupted cluster request that keeps defecting from stalling message delivery to other entities. - [#10218](Effect-TS/effect#10218) [`92201bc`](Effect-TS/effect@92201bc) Thanks @<!---->sbking! - Defer the runner notification for a discarded persisted send made inside a `ClusterSchema.WithTransaction` handler until the transaction commits. The message was invisible to the runner before the commit, so delivery waited for the next storage poll. - [#10260](Effect-TS/effect#10260) [`cf329f3`](Effect-TS/effect@cf329f3) Thanks @<!---->effect-bot! - Fix `ClusterWorkflowEngine` turning transient storage failures while saving durable clocks or deferred completions into workflow defects; they are now retried. - [#10262](Effect-TS/effect#10262) [`1d25d78`](Effect-TS/effect@1d25d78) Thanks @<!---->effect-bot! - Fix `ClusterWorkflowEngine` blocking shard reacquisition indefinitely after a forced shard release interrupted a …[full notes](https://github.com/Effect-TS/effect/releases/tag/effect%404.1.2) </details> <details> <summary><b>jose</b> (6.2.14 → 6.2.15)</summary> ### Fixes * **jwe:** cancel decompression when output exceeds the limit ([67541aa](panva/jose@67541aa)) * **jwks:** reject negative cache durations ([a3b296f](panva/jose@a3b296f)) * **jwt:** reject negative clockTolerance ([67d6c83](panva/jose@67d6c83)) </details> --- *This PR was auto-generated by [catalog-update-action](https://github.com/brandhaug/catalog-update-action).* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 of 5 tasks
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.
Summary
A forced shard release could stay pending forever when it interrupted a workflow
resumehandler that was waiting on the parent's active run.Entity shutdown interrupts the uninterruptible
resumehandler, so the interrupt stays pending. When the run's reply waiter then fails withEntityNotAssignedToRunner,ClusterAbandon.interruptopened an interruptible region before adding the Abandon annotation. The pending outside interrupt fired there first, so the annotation was never added.ensureSuccessonly stops retrying on annotated abandonment, so it kept retrying and waited on a reply from a run that had already been retired. Because of that, the entity never closed and the shards were never reacquired.Fix
ClusterAbandon.interruptnow annotates the fiber before it opens the interruptible region. The fiber merges the annotated interrupt into any pending cause, so the cause that fires carries the Abandon annotation even when an outside interrupt was already pending.ensureSuccessis unchanged: it stops retrying, re-raises the abandonment, and the handler exits with an interrupt. The entity manager then leaves the durableresumerequest for replay, release finishes, and the next owner replays it. Reacquisition still waits for the old entity to close.An earlier revision of this PR instead stopped retrying interrupt-only causes in
ensureSuccess. That let the handler exit, but as aDiewrapping the sandboxed cause, which the RPC server routed through its fatal-defect path rather than the interrupt path the entity manager's replay logic is built on.Tests
packages/effect/test/cluster/ClusterWorkflowEngine.test.ts: "reacquires shards after a forced release interrupts a parent resume waiting on its active run". It fails before the fix and passes after.packages/effect/test/cluster(16 files, 286 tests) andpackages/effect/test/workflowpass.pnpm lintandpnpm checkare clean.Closes #10253
Closes EFF-3263