Mount: distinct exit codes for credential timeout vs network errors#6
Closed
tyrielv wants to merge 1 commit into
Closed
Mount: distinct exit codes for credential timeout vs network errors#6tyrielv wants to merge 1 commit into
tyrielv wants to merge 1 commit into
Conversation
During mount startup, TryInitializeAndQueryGVFSConfig now distinguishes three failure modes with unique process exit codes: - CredentialTimeout (10): git credential fill did not respond within 30 seconds — GCM is likely blocked waiting for interactive auth that nobody is answering (common on headless server machines). - AuthenticationError (9): credentials were provided but the server rejected them (expired PAT, insufficient permissions). - NetworkError (11): non-auth failure contacting the server (timeout, DNS, 5xx errors). Previously all three cases mapped to GenericError (3) or AuthenticationError (9), making it impossible for callers to distinguish 'GCM is hung' from 'bad credentials'. Also skip config query retries when a cache server is already configured locally. The mount will proceed with the fallback cache server on first failure rather than blocking on retries whose results would be discarded anyway. Signed-off-by: Tyrie Vella <tyrielv@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Stacked on microsoft#2030 (tyrielv/mount-timeout).
Problem
During mount startup, when \TryInitializeAndQueryGVFSConfig\ fails, all failure modes mapped to either \GenericError (3)\ or \AuthenticationError (9). This made it impossible to distinguish:
Additionally, when a cache server was already configured locally, mount would still retry the config query up to 7 times before falling back — blocking mount for up to 30+ seconds on retries whose results would be discarded anyway.
Changes
New exit codes:
Skip retries with cache server: When a cache server URL is already in local git config, \TryInitializeAndQueryGVFSConfig\ uses \maxRetries: 0\ (single attempt). If it fails, mount proceeds immediately with the fallback cache server.
Credential timeout: \git credential fill\ now has a 30-second timeout during mount startup (other credential paths retain infinite wait). If GCM doesn't respond in time, the error message says \Credential manager did not respond within 30 seconds\ and the exit code is 10.
Context
Observed in telemetry: user \sprabhu\ on \SPRABHU-SERVER\ hit repeated mount timeouts because GCM was blocking on interactive auth that nobody was answering. The mount process was alive but stuck in \git credential fill, and MountVerb's 60s pipe connect expired with a misleading 'GVFS.Mount process is not responding' error.