Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): enforce one owner per state directory #14694

Closedmaria-rckswants to merge 4 commits intomain fromfix/6097-single-state-owneropened View on GitHub

Showing 16 changed files with 51 additions and 1 deletion (loading 13).

x
0 of 16 viewed, 16 left
36 additions and 0 deletionsapps/desktop/src/backend/DesktopBackendManager.test.tsModified
View file
@@ -1,4 +1,5 @@
import {
+ SERVER_EXIT_CODE_STATE_DIR_OWNED,
DesktopBackendBootstrap,
type DesktopBackendBootstrap as DesktopBackendBootstrapValue,
DesktopTelemetryControlMessage,
@@ -123,6 +124,7 @@
readonly backendOutputLog?: Partial<DesktopObservability.DesktopBackendOutputLogShape>;
readonly onReady?: Effect.Effect<void>;
readonly onShutdown?: Effect.Effect<void>;
+ readonly onStateDirOwned?: Effect.Effect<void>;
readonly onPreflightFailed?: (
failure: DesktopBackendManager.PreflightFailure,
) => Effect.Effect<boolean>;
@@ -184,6 +186,7 @@
configResolve: input.configResolve ?? Effect.succeed(input.config ?? baseConfig),
...(input.onReady ? { onReady: () => input.onReady! } : {}),
...(input.onShutdown ? { onShutdown: () => input.onShutdown! } : {}),
+ ...(input.onStateDirOwned ? { onStateDirOwned: () => input.onStateDirOwned! } : {}),
...(input.onPreflightFailed ? { onPreflightFailed: input.onPreflightFailed } : {}),
});
​
@@ -1204,6 +1207,39 @@
+ it.effect("reports state-directory ownership once without scheduling another backend", () =>
+ Effect.scoped(