Skip to content

Retry transient Git config reads - #2130

Draft
Tyrie Vella (tyrielv) wants to merge 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/config-read-retry
Draft

Tyrie Vella (tyrielv) wants to merge 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/config-read-retry

Conversation

@tyrielv

Copy link
Copy Markdown
Contributor

Problem and Context

Concurrent Git processes can replace .git\config while VFS for Git reads it.
On Windows, a reader can receive a short Permission denied or sharing error during that replacement.
VFS for Git reads configuration through both git.exe and libgit2.
A retry in only one implementation would leave other config readers exposed to the same race.
No direct .git\config reader bypasses these two implementations.

Changes

  • Add one bounded retry policy for all git.exe and libgit2 config reads.
  • Retry only transient file-access failures, with five attempts and exponential delays from 20 to 160 milliseconds.
  • Preserve missing-key results and fail non-transient errors without a retry.
  • Keep config writes unchanged.
  • Trace each retry with the config key, attempt number, retry limit, and delay.
  • Buffer libgit2 multivalue results before callbacks, so a retry cannot duplicate callback effects.
  • Add unit coverage for recovery, missing keys, persistent failures, non-transient failures, and libgit2 retries.

Use one bounded retry policy for git.exe and libgit2 config reads. Retry only transient file access failures and preserve existing missing-key behavior.

Assisted-by: GPT-5.6 Sol

Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant