Repository navigation
fix: stop waiting for the snapshot store once the run stops - #496
Merged
Merged
Conversation
A request outside Git records its base by snapshotting under the store's lock, waiting up to 30 s for another session's snapshot, and nothing of it heard the stop, so abort() waited out the 30 s. The run's signal now reaches captureBase, takeSnapshot and withLockWhile: a stop ends the wait for the lock and starts no Git step, while work that holds the lock runs to its end. Found by Sol reading the loop; reproduced with the store held by another.
Sequela02
force-pushed
the
fix/stop-base-capture
branch
from
October 18, 2026 19:27
d01b8b9 to
ea63a31
Compare
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.
Part 7 of the move to Effect became fixing the places in the engine's loop that do not hear a stop (debated with GPT-6 Astra and GPT-6.1 Sol, and measured; the owner approved fixing them directly rather than moving
loop.tsto Effect). This is the request's base. Found by Sol reading the code; reproduced and fixed by Claude.Defect
Before a request runs, the loop records its base (
captureBase), and in a folder outside Git that takes a snapshot under the snapshot store's lock, waiting up to 30 s for another session's snapshot. None of it heard the stop, andabort()awaits the run, so stopping a request while the store was held waited out the 30 s. Reproduced ondevwith the real path: the test holds the store's lock, starts a request in a folder outside Git and stops it;abort()returned after 30.2 s.Change
withLockWhiletakes an optional signal: a stop ends the wait for the lock (refused as the lock being held). Work that already holds the lock runs to its end, so the lock is never released under it.takeSnapshottakes the signal: it does not wait for the store, nor start a Git step, once the run is stopped, and returns "the run was stopped before the snapshot was taken". A Git step under way is short and runs to its end:gitOutputalready explains why Git is not killed (on Windowsgitcan be a launcher, and killing it leaves Git running).captureBaseand the loop pass the run's signal through;HostParts.withLockWhileandLoopOptions.captureBasetake it.Checks
packages/core/tests/snapshot.test.ts: the store held by another, a request started and stopped; it ends aborted within 5 s, with the base's unit refused for the stop. Ondevit waits 30 s and fails; with the change it passes.bun run checklocally (Windows): Tests 264 passed (264); 332 pass; 3 skip; Over budget: shellRssBytes: 120913920 is over its limit of 115000000.