microsoft / git

A fork of Git containing Microsoft-specific patches.
http://git-scm.com/
Other
761 stars 92 forks source link

gvfs-helper: add `gvfs.fallback` config option #664

Closed derrickstolee closed 2 months ago

derrickstolee commented 2 months ago

By default, GVFS Protocol-enabled Scalar clones will fall back to the origin server if there is a network issue with the cache servers. However (and especially for the prefetch endpoint) this may be a very expensive operation for the origin server, leading to the user being throttled. This shows up later in cases such as 'git push' or other web operations.

To avoid this, create a new config option, 'gvfs.fallback', which defaults to true. When set to 'false', pass '--no-fallback' from the gvfs-helper client to the child gvfs-helper server process.

This will allow users who have hit this problem to avoid it in the future. In case this becomes a more widespread problem, engineering systems can enable the config option more broadly.

Enabling the config will of course lead to immediate failures for users, but at least that will help diagnose the problem when it occurs instead of later when the throttling shows up and the server load has already passed, damage done.


dscho commented 2 months ago

I wonder whether this would merit a new test case in t5799-gvfs-helper.sh to ensure that the config option keeps working as intended. @jeffhostetler what are your thoughts on that?

jeffhostetler commented 2 months ago

Let me look at the test suite now.

jeffhostetler commented 2 months ago

Please see https://github.com/microsoft/git/pull/665

dscho commented 2 months ago

@derrickstolee if you're okay with #665, I'd like to take that and close this here PR?

derrickstolee commented 2 months ago

Closing in favor of #665.