Fix staged upgrade races and installer error handling#1961
Merged
tyrielv merged 1 commit intoMay 8, 2026
Conversation
Address review feedback from microsoft#1958: - StopService/StagingUpdateService: check sc.exe exit code separately from Exec launch failure. Previously non-zero sc.exe results were silently ignored. - Timer race: wrap pendingUpgradeTimer create/reset in a lock. Two concurrent unmounts on separate pipe threads could both observe null and create duplicate timers, causing parallel TryApplyPendingUpgrade. - .ready race: move service start from AfterInstall hook to ssPostInstall after .ready marker is written. Previously the service could start its 5s debounce timer before .ready existed, skip the upgrade, and leave staged files until the next service restart. Assisted-by: Claude Opus 4.6 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
KeithIsSleeping
approved these changes
May 8, 2026
Merged
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.
Follow-up to #1958 addressing review feedback from @KeithIsSleeping:
StopService/StagingUpdateService error handling -
Execreturns false only when sc.exe can't launch. Non-zero sc.exe exit codes were silently ignored. Now checks ResultCode separately and logs/raises on failure.Timer race in RequestHandler - Two concurrent unmounts on separate pipe threads could both see
pendingUpgradeTimer == nulland create duplicate timers. Addedlockaround timer create/reset..readymarker race - Service was started viaAfterInstallhook before.readywas written inssPostInstall. If the last mount exited during install, the debounce timer would fire, skip (no.ready), and staged files would sit until next restart. Moved service start to after.readyis written.