Skip to content

Route GVFS endpoints to dedicated cache servers - #2103

Open
Derrick Stolee (derrickstolee) wants to merge 4 commits into
microsoft:masterfrom
derrickstolee:gvfs-endpoint-config
Open

Route GVFS endpoints to dedicated cache servers#2103
Derrick Stolee (derrickstolee) wants to merge 4 commits into
microsoft:masterfrom
derrickstolee:gvfs-endpoint-config

Conversation

@derrickstolee

@derrickstolee Derrick Stolee (derrickstolee) commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Why This Matters

The microsoft/git GVFS helper can route protocol endpoints to dedicated cache servers, but VFS for Git previously sent every protocol request to one global cache URL. Supporting the same endpoint-specific preferences lets cache infrastructure migrate incrementally without making a dedicated endpoint a hard dependency.

The /gvfs/sizes endpoint is unique to VFS for Git, so this change adds the corresponding gvfs.sizes.cache-server setting alongside the prefetch, GET, and POST settings used by Scalar.

Commit Narrative

  1. Route GVFS endpoints to dedicated cache servers: load, persist, and validate endpoint overrides; add matching gvfs clone options; preserve overrides during mount-time cache resolution.
  2. Fall back safely from dedicated cache endpoints: retry failed endpoint requests through the global cache, preserve circuit-breaker budgets, distinguish network body failures from local processing errors, propagate cancellation unchanged, and emit authority-only telemetry.
  3. Explain endpoint-specific cache routing: document configuration, precedence, fallback order, and troubleshooting.
  4. Cover prefetch failure telemetry redaction: exercise terminal prefetch failures at the production entry point and ensure diagnostics retain only URI authority.

Routing and Fallback Behavior

  • gvfs.prefetch.cache-server routes /gvfs/prefetch.
  • gvfs.get.cache-server routes object GET requests.
  • gvfs.post.cache-server routes object POST requests.
  • gvfs.sizes.cache-server routes /gvfs/sizes.
  • If an endpoint-specific route is absent or fails, the request uses gvfs.cache-server.
  • Sizes requests can additionally fall back from the global cache to origin.
  • Existing repositories without endpoint overrides retain their previous behavior.

Endpoint-to-global transitions do not consume the process-wide circuit-breaker budget. Response-body transport failures can trigger fallback, while local processing failures remain on the current route. OperationCanceledException propagates without retry or fallback. Fallback and terminal prefetch diagnostics include only URI authority, excluding credentials, paths, queries, and fragments.

Clone and Configuration Surface

gvfs clone accepts --prefetch-cache-server-url, --get-cache-server-url, --post-cache-server-url, and --sizes-cache-server-url. Values are stored in local Git config and malformed absolute URLs are rejected.

gvfs cache-server --get and --set continue to operate only on the global cache setting. Endpoint-specific values can be inspected or changed with git config --local.

Related microsoft/git Changes

Tests

Coverage includes configuration precedence and persistence, mount-time resolution, clone option parsing and URL validation, endpoint/global/origin routing, HTTP and transport failures, response-body failures, local handler failures, cancellation propagation, telemetry redaction, terminal endpoint reporting, and circuit-breaker accounting.

@derrickstolee

This comment has been minimized.

@derrickstolee Derrick Stolee (derrickstolee) added the agency-rocket Touched by a rocket skill label Aug 31, 2026
@derrickstolee Derrick Stolee (derrickstolee) changed the title [Agent Created] Route GVFS endpoints to dedicated cache servers Route GVFS endpoints to dedicated cache servers Aug 31, 2026
@derrickstolee

Copy link
Copy Markdown
Contributor Author

This PR has not yet been vetted by the author.

It has now been vetted.

@tyrielv
tyrielv self-requested a review August 31, 2026 18:39
@tyrielv

tyrielv commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

InProcessMount.cs looks like it needs a call to WithEndpointOverridesFrom

@derrickstolee

Copy link
Copy Markdown
Contributor Author

🤖 Agreed - I am tracing this cache resolution path and will preserve the endpoint-specific overrides here as well.


AI response generated by rocket

@derrickstolee

Copy link
Copy Markdown
Contributor Author

🤖 Fixed in 072c1690: mount-time global cache resolution now reapplies the endpoint-specific overrides from local config, matching the existing clone, prefetch, and verb resolution paths.


AI response generated by rocket

@tyrielv tyrielv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Machine-drafted review (Review Swarm), reviewed and approved by me before posting. Five inline notes below; the circuit-breaker one is the load-bearing item.

Comment thread GVFS/GVFS.Common/Http/GitObjectsHttpRequestor.cs
Comment thread GVFS/GVFS.Common/Http/GitObjectsHttpRequestor.cs Outdated
Comment thread GVFS/GVFS.Common/Http/GitObjectsHttpRequestor.cs Outdated
Comment thread GVFS/GVFS.Common/Http/GitObjectsHttpRequestor.cs Outdated
Comment thread GVFS/GVFS.UnitTests/Http/GitObjectsHttpRequestorTests.cs
Context:
The microsoft/git GVFS helper supports endpoint-specific cache servers so cache infrastructure can be migrated independently. VFS for Git previously sent every protocol request to one global URL.

Justification:
Use the same gvfs.<endpoint>.cache-server keys and clone option names as Scalar. Keeping endpoint preferences on CacheServerInfo centralizes precedence and lets mount-time cache resolution preserve the configured routes.

Implementation:
Load, persist, and validate overrides for prefetch, object GET, object POST, and sizes requests. Add matching clone options, retain the global cache as the default, preserve overrides while resolving cache identity, and cover configuration, CLI parsing, and mount resolution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Context:
Endpoint-specific cache servers are preferences above the global cache, but failures previously terminated requests instead of using the healthy fallback route. Early fallback handling also charged abandoned attempts to the process-wide circuit breaker, confused cancellation with transport failure, and exposed excess URI data in telemetry.

Justification:
Treat route failover separately from transient retry accounting. Cancellation remains control flow, local processing errors stay on the active route, and network-body failures alone can move a request to the global cache. Authority-only metadata preserves diagnostics without exposing credentials or request details.

Implementation:
Fall back prefetch, object GET, object POST, and sizes requests through the global cache, with sizes retaining its final origin fallback. Track response-stream failures, preserve circuit-breaker budget across route transitions, propagate cancellation unchanged, validate endpoint URLs, and emit redacted fallback telemetry. Add focused coverage for HTTP, transport, body-read, local-write, cancellation, telemetry, and terminal failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Context:
Administrators need to understand how dedicated GVFS endpoint caches interact with the existing global cache and with gvfs cache-server commands.

Justification:
Documenting precedence and fallback behavior alongside the configuration keys makes staged cache migrations predictable and preserves the distinction between global and endpoint-specific settings.

Implementation:
Describe the clone options, local Git config keys, endpoint-to-global fallback order, the sizes-to-origin fallback, and troubleshooting guidance for inspecting or changing endpoint overrides.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Context:
The prefetch entry point now reports only URI authority when a request fails, but requestor-level tests did not execute the warning and unsupported-command telemetry paths that consume the terminal request URI.

Justification:
Exercise the production composition directly so future changes cannot reintroduce credentials, paths, queries, or fragments into prefetch failure diagnostics. These focused cases also raise changed-line coverage above the repository threshold without relying on incidental functional-test execution.

Implementation:
Add a deterministic prefetch requestor that returns terminal HTTP failures. Verify both general failure warnings and not-supported events emit only the host and port from a credential-bearing request URI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agency-rocket Touched by a rocket skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants