Repository navigation
Conversation
Effect.cached drops an interrupted run since effect 4.0.1 (#8719, bc44526), so a second actor.start after an interrupted first start ran recovery and the startup again. The actor now keeps the first start's exit itself.
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.
Bumps the dev and test pins (
effect,@effect/atom-react,@effect/atom-solid, root and examples) from 4.0.0 to 4.1.7, the version Bite moves to (biteinc/maitred#22300). It also fixes the one test that fails on the new pin. Do not merge without the owner: this PR changes source and carries a patch changeset, so merging it opens a Version Packages PR.The failure
test/actor-lifecycle.test.ts› "retains an interrupted first start until the actor is stopped" hangs on effect 4.1.7: it still hangs with a 60 s timeout. On 4.0.0 it passes in under 1 s. With logs: on 4.0.0, a secondactor.startafter the first start was interrupted returns the first start's interrupt (recovery ran once). On 4.1.7 the secondstartruns recovery and the startup again (recovery ran twice). The test's recovery never returns, so the second start hangs.Cause (bisected)
Same test, same source, only the
effectpin changed:effect 4.0.1 replaced
Effect.cachedwithmakeCachedUnsafe: Effect-TS/effect#8719 (bc44526), "Treat interruption as abandonment inEffect.cached… interrupted results are never cached, and a call made while an abandoned computation is still finalizing starts a fresh one".actor.startwasEffect.cached(...)(src/actor.ts), so an interrupted first start is no longer retained.Fix
startnow keeps the first start's exit itself. The first call runs the startup and records its exit, interruption included, in aDeferred. Every later call awaits that exit. This restores the documented contract ofActorRef.start: "The first failure or interruption is retained. Stop that actor and spawn a new actor to retry initialization."Run locally (effect 4.1.7, under load 40-88 from another session)
bun run typecheck,bun run lint,bun run fmt:check: exit 0.test/**/*.test.tsfile, one per process: all pass except the two below.test/actor-lifecycle.test.ts: 8/8 with the fix. Without the fix it hangs.test/stale-signal.property.test.ts: timed out at 5 s. It also times out on the base under this load, so the timeout is not caused by this change.test/wait-order.test.ts: 34/35. One generated case out of 24,084 ("sendAndWait, with its start racing actor.start", a supervised restart case with time budgets) hung instead of returningActorStoppedError. The run took 88 s at load above 40. I have not yet rerun it at low load. CI on this PR is the clean signal.