fix: publish complete compiled worker generations atomically - #273
Draft
seanperkins wants to merge 2 commits into
Draft
seanperkins wants to merge 2 commits into
seanperkins wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Concurrent host-service startup can expose partially compiled JavaScript, and the old fingerprint misses dependency/compiler changes. This follow-up builds each version in a private staging directory, atomically publishes a complete immutable generation, and runs each service from its selected generation.
It also fingerprints lockfiles, the installed compiler, Node, TypeScript/declaration inputs and MJS sidecars. Runtime MJS helpers are copied into the generation so later imports remain consistent. Failed builds preserve prior output and refuse to start stale code.
This draft is stacked on #244 (
syd-268-precompile-host-scripts); its diff contains only the follow-up fix. No merge or deployment performed.Closes #272.
Validation:
Operational notes: simultaneous cold starts can duplicate compilation safely. Old generations remain available for running services; stop all services before clearing
dist/server. The root metadata file describes the last selected build, not all running processes.