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

Feature request - allow requesting a lock timeout

From
Nathan Neulinger <nneul@neulinger.org>
Date
Dec 4, 2015, 14:28 UTC
Message-ID
<5661A30B.6030803@neulinger.org>

It appears that almost all of the locking calls in the current code use hold_lock_file_for_update() which translates into a request with zero timeout.

This effectively means that for certain classes of usage, you can't use git concurrently without either external locking or retry logic. It would be nice to see a global option "--lock-timeout" that would request a specific non-zero default timeout for many of those operations.

Even having the option to have a couple-second timeout would eliminate most typical concurrency issues, simplifying some automated use cases.

Horrible/contrived example, but demonstrates the issue:
	for f in `seq 1 150`; do touch $f; (git add $f &); done
You'll get a whole bunch of:
	fatal: Unable to create '/tmp/dummy/.git/index.lock': File exists.
-- Nathan

------------------------------------------------------------ Nathan Neulinger nneul@neulinger.org Neulinger Consulting (573) 612-1412

Message 1 of 1 in “Feature request - allow requesting a lock timeout”
  1. Nathan NeulingerDec 4, 2015

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.