Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): queued messages no longer wait out every timed-out checkpoint in a shared folder #40411

MergedExSidius(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/40411/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 156 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
2 additions and 0 deletionsapps/server/src/orchestration-v2/CheckpointCaptureService.test.tsModified
View file
@@ -311,6 +311,7 @@
: Layer.mock(CheckpointService.CheckpointServiceV2)({
+ capturesSoFar: () => Effect.succeed(0),
repositoryScopes: () => Effect.succeed([]),
materializeBaselineCheckpoint: () =>
Effect.die(
@@ -892,6 +893,7 @@
Layer.mergeAll(
IdAllocator.layer,
Layer.mock(CheckpointService.CheckpointServiceV2)({
+ capturesSoFar: () => Effect.succeed(0),
repositoryScopes: () => Effect.succeed([]),
materializeBaselineCheckpoint: () =>
Effect.die("baseline materialization must be skipped when ordinal 0 is ready"),
3 additions and 0 deletionsapps/server/src/orchestration-v2/CheckpointCaptureService.tsModified
View file
@@ -135,6 +135,8 @@
// Each scope is checked on its own, so a retried capture fills only what is missing.
const captureRoot = Effect.gen(function* () {
+ // Materializing a baseline waits on the folder's lock before the capture does.
+ const capturesBeforeLock = yield* checkpoints.capturesSoFar(scope.cwd);
const threadStartCheckpoint =
baselineOrdinalWithinScope === 0 || isPreserved(0) ? null : yield* materializeBaseline(0);
const baselineCheckpoint = isPreserved(baselineOrdinalWithinScope)