Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Conversation

@DefaultRyan
Copy link
Member

@DefaultRyan DefaultRyan commented Oct 18, 2024

Summary of the pull request

The GitConfiguration class is thread-safe, but it still resulted in multiple threads trying to store the configuration file concurrently. This concurrent access mostly hit when browsing to a folder in File Explorer for the first time in the Git extension process life, as multiple threads tried to perform the initial Git detection concurrently. Making the _fileLock field static ensures that only one thread can access the file at a time.

Validation steps performed

Prior to fix, when using a debug build, multiple file IO exceptions were logged in the git integration console window when first browsing to a registered folder. After fix, these IO exceptions are no longer encountered.

PR checklist

@DefaultRyan DefaultRyan merged commit 4543131 into main Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition storing git config (detects presence of command-line Git)

4 participants