git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Credential Store: Don't acquire lock when only reading the file

From
Simão Afonso <simao.afonso@powertools-tech.com>
Date
Oct 30, 2020, 12:05 UTC
Message-ID
<20201030120540.dna7k3bmnrrw4cck@safonso-t430>
In-Reply-To
<20201030055541.GA3264588@coredump.intra.peff.net>
On 2020-10-30 01:55:41, Jeff King wrote:
>       - teach it to try the lock until hitting a timeout. I think just
> 	swapping out hold_lock_file_for_update() for
> 	hold_lock_file_for_update_timeout() would do it (I probably
> 	would have used it back then, but it didn't exist yet).

So I tried to patch the credential store with that timeout function and it seems to solve it! Thanks.

https://github.com/git/git/blob/v2.29.2/builtin/credential-store.c#L61

This is easily reproduced if you do a `fetch --all` in parallel on the same repository (seen on the attached image):

> $ for n in $(seq 100); do git fetch --all; sleep 0.5; done

About the timeout, I put it at infinite retries, but should this be configurable? Or should it be a different default?

There aren't many timeout configurations. I found "core.filesRefLockTimeout" and "core.packedRefsTimeout", doesn't sound like something that should be re-used. Should it be something like this with a different name?

Previous: Simão AfonsoNext: Jeff King
Message 6 of 7 in “Credential Store: Don't acquire lock when only reading the file”
  1. Simão AfonsoOct 29, 2020
  2. Jeff KingOct 30, 2020
  3. Simão AfonsoOct 30, 2020
  4. Jeff KingOct 30, 2020
  5. Simão AfonsoOct 30, 2020
  6. Simão AfonsoOct 30, 2020
  7. Jeff KingOct 30, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.