Fix: --unmount-all now triggers pending staged upgrade#1975
Closed
tyrielv wants to merge 1 commit into
Closed
Conversation
'gvfs service --unmount-all' sets SkipUnregister on each unmount to preserve automount registration. This meant no UnregisterRepoRequest reached the service, so RequestHandler never called TryDeferredPendingUpgradeCheck and staged upgrades were never applied. Add PendingUpgradeCheckRequest message type. ServiceVerb sends it after the --unmount-all loop completes so the service can schedule the same deferred upgrade check that individual unmounts trigger. Also add 'unmount-all-triggers-upgrade' scenario to upgrade-tests.yaml CI matrix to cover this path end-to-end. Assisted-by: Claude Opus 4.6 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
e33da2a to
af4eb1c
Compare
Contributor
Author
|
Closing for now - this approach doesn't work when upgrading from older version to the first version that has this. |
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.
Problem
When an installer runs while mounts are active, it stages new files to
PendingUpgrade\instead of replacing files in-place. The service issupposed to apply the upgrade when all mounts are unmounted.
This works correctly for
gvfs unmountbecause each unmount sends anUnregisterRepoRequestto the service, which triggersTryDeferredPendingUpgradeCheckinRequestHandler.However,
gvfs service --unmount-allsetsSkipUnregister = trueoneach unmount (to preserve automount registration), so no message reaches
the service and the staged upgrade is never applied — it sits in
PendingUpgrade\indefinitely until the next service restart.Fix
New
PendingUpgradeCheckRequestnamed pipe message (3 files, ~65 lines):NamedPipeMessages.cs— AddedPendingUpgradeCheckRequestwithheader,
FromMessage/ToMessage, andResponse(follows existingEnableAndAttachProjFSRequestpattern).RequestHandler.cs— Handle the new message by calling the existingTryDeferredPendingUpgradeCheck(same debounced timer that individualunmounts use) and returning a success response.
ServiceVerb.cs— After the--unmount-allloop completes, sendPendingUpgradeCheckRequestto the service pipe. Placed before thefailure exit path so partial unmount failures still trigger the check.
Notification failure is treated as a warning (unmounts themselves succeeded).
The service-side
PendingUpgradeHandler.TryApplyPendingUpgradealreadychecks for running
GVFS.Mountprocesses and defers if any are present,so sending the notification even after partial unmount failures is safe.
Test
Added
unmount-all-triggers-upgradescenario to the CI upgrade test matrix(
upgrade-tests.yaml). It follows the same pattern asstaging-upgradebut uses
gvfs service --unmount-allinstead of per-repo unmount, thenpolls for
PendingUpgrade\directory removal to confirm the upgradeapplied without needing a service restart.