Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): pause service restart when disk is full #25924

Mergedgyurix(GitHub profile, opens in a new tab)merged 13 commits intomain fromrefs/pull/25924/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 206 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
206 additions and 0 deletionsapps/server/src/serviceLauncher.test.tsModified
View file
@@ -201,6 +201,212 @@
});
​
it.layer(NodeServices.layer)("service state persistence", (it) => {
+ it.effect.each([
+ "startup",
+ "log write fails",
+ "home probe error",
+ "database probe error",
+ "pending update",
+ "update handoff",
+ "trial exit",
+ "failed trial start",
+ "stop",
+ ] as const)("waits for disk recovery during %s without losing the update lifecycle", (scenario) =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const root = yield* fs.makeTempDirectoryScoped({ prefix: "t3-service-disk-" });
+ const statePath = path.join(root, "runtime", "service-state.json");
+ const databasePath = path.join(root, "userdata", "statev2.sqlite");
+ let backupPath = path.join(root, "runtime", "db-backup", "disk-update");
+ const pending = {
+ id: "disk-update",
+ fromVersion: "1.0.0",
+ targetVersion: "1.1.0",
+ dbPath: databasePath,
+ status: "pending" as const,
+ };
+ yield* fs.makeDirectory(path.dirname(databasePath), { recursive: true });