git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Feature request - allow requesting a lock timeout
@ 2015-12-04 14:28 Nathan Neulinger
  0 siblings, 0 replies; only message in thread
From: Nathan Neulinger @ 2015-12-04 14:28 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-04 14:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-04 14:28 Feature request - allow requesting a lock timeout Nathan Neulinger

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).