Repository navigation
fix(server): remote updates no longer fail when the staged preflight is slow on a loaded host - #28201
Merged
Merged
Conversation
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.
Problem
A remote (boot-service) server update fails on a heavily loaded host: the staged runtime's
__service-preflightis killed by a fixed 30 s timeout while it is still cold-starting, so the update ends with "Could not prepare t3@." and the host stays on the old version.Reproduced on main with a real launcher-managed server paired as a remote environment in the web client, clicking "Update for ", with a staged runtime whose preflight takes 45 s (standing in for a cold start on a swapping host):
PinnedRuntimeInstallErrorcaused byProcessTimeoutError ... timed out after 30000ms.Change
PREFLIGHT_TIMEOUTinapps/server/src/cloud/selfUpdate.tsgoes from 30 seconds to 3 minutes. The preflight only starts the new runtime and reads the database's migration head, so a slow host now gets time to finish its cold start. A preflight that hangs still fails, just after 3 minutes instead of 30 s.Scope and approval
Fixes #28198
Triaged via the automated issue flow.
Verification
server self update > waits for a staged preflight that takes a minute on a loaded hostinapps/server/src/cloud/selfUpdate.test.ts. Its fake preflight takes 60 s on theTestClockand enforces the caller's timeout the wayProcessRunnerdoes. On main it fails withServerSelfUpdateError: Server update failed: Could not prepare [email protected]. (cause: PinnedRuntimeInstallError ... (cause: ProcessTimeoutError: ... timed out after 30000ms)). On this branch all 10 tests in the file pass.vp run check:changed: format, lint, knip, typecheck and tests all pass.server.trace.ndjson):The last failure is the scratch launcher refusing on purpose. A real boot-service launcher activates the staged runtime at that point. The driver scripts (fake launcher, release server, stall script) are scratch and not part of this PR.
Not checked: a real loaded host, the desktop app as the client, macOS and Windows hosts. A server-only fix has no render path, so there are no captures.
Model and harness: Claude Opus 5.5 (claude-opus-5-5) via Claude Code in T3 Code; reviews by Codex gpt-6.1-sol and Claude Opus 5.5.
🤖 Generated with Claude Code