Skip to content

Warn about stalled forced shard releases - #9475

Merged
tim-smart merged 7 commits into
mainfrom
agent/effect-bot/5b4cbf9298bf
Oct 18, 2026
Merged

tim-smart merged 7 commits into
mainfrom
agent/effect-bot/5b4cbf9298bf

Conversation

@effect-bot

Copy link
Copy Markdown
Contributor

Summary

  • Warn once when a forced shard release exceeds shardLockExpiration, with shard IDs, pending entity types, and singleton names. The independent, interruptible monitor is cleaned up when release exits.
  • Promote release-retry failures to warnings, limited to one per 30 seconds per release operation; keep the existing 50 ms retry spacing.
  • Preserve teardown-before-release ordering and the forced-release acquisition gate. No public API, ownership-policy, or shutdown-deadline changes.
  • Continue from the separate tests-only commit; regression tests are unchanged in this implementation run.

Validation

  • Confirmed the existing regression fails before implementation (missing warning).
  • nix develop -c pnpm test --run packages/effect/test/cluster/Sharding.test.ts --reporter=dot: 95 passed.
  • nix develop -c pnpm lint-fix
  • nix develop -c pnpm check
  • git diff --check

Assessment / follow-up

Current main already updates ClusterMetrics.shards from the acquired-shard set after normal release marking, acquisition, unhealthy-storage clearing, and refresh lock loss (fixed in #9244). Zero acquired shards can still coexist with pending teardown; the new warning explains that state. No metric change or public owned-shard count is needed for this diagnostic fix.

The unchanged minimal regression covers stalled singleton diagnostics, warning non-repetition, cleanup after recovery, and release-before-reacquisition safety. A separate tests run should cover entity-type diagnostics, completion before the warning deadline, and the release-failure warning throttle. Independent review and Architect simplification remain required.

Closes #9467
Closes EFF-2418

@changeset-bot

changeset-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 99ba16d

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

This PR includes changesets to release 33 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare 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/graphql-generator 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 17, 2026

@effect-janitor effect-janitor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete: one blocking finding for missing regression coverage of release-failure warning throttling. Static review and diff whitespace check completed; runtime tests could not run because the pnpm bootstrap failed in this sandbox.

Reviewed at 2632ceb: 1 blocking, 0 nits.

Disagree? Reply in the finding's thread, or a maintainer can comment /janitor to re-run or dismiss this review.

Comment thread packages/effect/src/cluster/Sharding.ts Resolved

@effect-janitor effect-janitor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete: the earlier blocking coverage finding is addressed, and no new issues were found. Validated with packages/effect/test/cluster/Sharding.test.ts: all 97 tests passed. git diff --check also passed.

Reviewed at 943a6b5: no new findings.

@effect-janitor
effect-janitor Bot dismissed their stale review October 17, 2026 21:25

Dismissed by janitor: no blocking finding stands at 943a6b5.

@github-actions

github-actions Bot commented Oct 17, 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 39.08 KB 39.08 KB 0.00 KB (0.00%)
basic.ts 7.02 KB 7.02 KB 0.00 KB (0.00%)
batching.ts 10.81 KB 10.81 KB 0.00 KB (0.00%)
brand.ts 6.71 KB 6.71 KB 0.00 KB (0.00%)
cache.ts 11.33 KB 11.33 KB 0.00 KB (0.00%)
config.ts 22.52 KB 22.52 KB 0.00 KB (0.00%)
differ.ts 21.60 KB 21.60 KB 0.00 KB (0.00%)
http-client.ts 23.99 KB 23.99 KB 0.00 KB (0.00%)
http-router.ts 35.64 KB 35.64 KB 0.00 KB (0.00%)
logger.ts 11.68 KB 11.68 KB 0.00 KB (0.00%)
metric.ts 9.16 KB 9.16 KB 0.00 KB (0.00%)
optic.ts 6.93 KB 6.93 KB 0.00 KB (0.00%)
pubsub.ts 15.77 KB 15.77 KB 0.00 KB (0.00%)
queue.ts 12.59 KB 12.59 KB 0.00 KB (0.00%)
schedule.ts 11.77 KB 11.77 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 13.81 KB 13.81 KB 0.00 KB (0.00%)
schema-binary.ts 40.57 KB 40.57 KB 0.00 KB (0.00%)
schema-class.ts 21.31 KB 21.31 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 32.38 KB 32.38 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 27.59 KB 27.59 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.06 KB 15.06 KB 0.00 KB (0.00%)
schema-string.ts 12.07 KB 12.07 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.29 KB 16.29 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 38.60 KB 38.60 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 25.66 KB 25.66 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 20.54 KB 20.54 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 20.73 KB 20.73 KB 0.00 KB (0.00%)
schema-toFormatter.ts 20.84 KB 20.84 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 25.46 KB 25.46 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 20.83 KB 20.83 KB 0.00 KB (0.00%)
schema.ts 20.50 KB 20.50 KB 0.00 KB (0.00%)
stm.ts 13.87 KB 13.87 KB 0.00 KB (0.00%)
stream.ts 10.10 KB 10.10 KB 0.00 KB (0.00%)

The forced release warning tracked every entity interrupt fiber in a map
with an observer, only to learn which entity types still had servers on
the stalled shards. The entity manager already knows that from the close
latches that interruptShard waits on, so ask it directly when the warning
fires and drop the bookkeeping from the interrupt path.
effect-janitor[bot]
effect-janitor Bot previously approved these changes Oct 18, 2026
@tim-smart
tim-smart merged commit bcb3a86 into main Oct 18, 2026
13 checks passed
@tim-smart
tim-smart deleted the agent/effect-bot/5b4cbf9298bf branch October 18, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sharding: runner silently owns zero shards forever when a singleton/entity on a force-released shard cannot be interrupted

2 participants