git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unknown error with concurrent config read/write on Windows
@ 2025-02-07  2:44 Allen Li
  2025-02-24 12:53 ` Patrick Steinhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Allen Li @ 2025-02-07  2:44 UTC (permalink / raw)
  To: git

On Windows, Git encounters fatal errors (that do not happen on Linux)
when reading and writing the Git config in parallel processes.

I and some peers can relatively easily reproduce this by running in
parallel (e.g., in two separate terminal/PowerShell windows):

for (;;) {git rev-parse HEAD}
for (;;) {git config --local user.name foo}

The rev-parse "thread" will spew messages like:

f100762176b7b085e81cafe261a049d809772ace
f100762176b7b085e81cafe261a049d809772ace
f100762176b7b085e81cafe261a049d809772ace
warning: unable to access '.git/config': Permission denied
fatal: unknown error occurred while reading the configuration files
f100762176b7b085e81cafe261a049d809772ace

This affects any command that reads the Git config (which is all/most
of them); rev-parse is just a convenient stand-in.

I have seen the work to make lockfile renames (and thus config edits I
believe) more atomic in
https://lore.kernel.org/all/cover.1729695349.git.ps@pks.im/T/ which
should be in 28.0 IIUC.

However, the above issue can still be reproduced with an RC build of
28.0 (of the Git for Windows distribution).

Based on where the unknown error text occurs in the code, I speculate
that the "atomic rename" of config.lock to config is allowing
subsequent readers to read an incomplete version of the config file,
which means that the fix I referenced above may be deficient in some
way.

I will omit the context around my problem, which can be summarized as
"legacy infrastructure/scripts", but I'd like to frame this bug report
as "this works on Linux, but not on Windows" in the hopes of getting
some help, although I understand this may not be the highest priority.

(Apologies in advance for my ignorance with Windows and/or using this
mailing list.)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-19 22:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07  2:44 Unknown error with concurrent config read/write on Windows Allen Li
2025-02-24 12:53 ` Patrick Steinhardt
2025-03-19 22:16   ` Allen Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).