fix(server): wait for launchd bootout safely #12005
Closedkeithce(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/12005/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -669,0 +740,21 @@740+ (cause) =>741+ new BootServiceCommandError({742+ step: "checking whether the launch agent stopped",743+ cause,744+ }),745+ ),746+ );747+ if (isConfirmedLaunchdNotLoaded(printResult, entry.verifyAbsent.notLoadedMessages)) return;748+ if (bootoutError !== undefined) return yield* bootoutError;749+ if (printResult.code !== 0) {750+ return yield* new BootServiceCommandError({751+ step: "checking whether the launch agent stopped",752+ exitCode: printResult.code === null ? undefined : Number(printResult.code),753+ stdoutLength: printResult.stdout.length,754+ stderrLength: printResult.stderr.length,755+ });756+ }757+ yield* Effect.sleep(LAUNCHD_STOP_POLL_INTERVAL);758+ }759+ }).pipe(760+ Effect.timeoutOrElse({
- apps/server/src/cloud/bootService.ts lines 726 to 732Resolvedby keithce(GitHub profile, opens in a new tab)@@ -667,3 +708,19 @@667708 );668709 });669710711+ const runLaunchdBootout = Effect.fn("cloud.boot_service.run_launchd_bootout")(function* (712+ entry: Extract<BootServiceStep, { readonly operation: "launchd-bootout" }>,713+ ) {714+ yield* Effect.gen(function* () {715+ const bootoutResult = yield* runner716+ .run({ command: entry.command, args: entry.args, timeout: entry.timeout })717+ .pipe(Effect.mapError((cause) => new BootServiceCommandError({ step: entry.step, cause })));718+ const bootoutError =719+ bootoutResult.code === 0720+ ? undefined721+ : new BootServiceCommandError({722+ step: entry.step,723+ exitCode: bootoutResult.code === null ? undefined : Number(bootoutResult.code),724+ stdoutLength: bootoutResult.stdout.length,725+ stderrLength: bootoutResult.stderr.length,726+ });
juliusmarminge added labelsmacroscope-review
maria-rcks closed this
Sign in to join this conversation.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. To continue using code reviews, add credits to your account and enable them for code reviews in your settings.