Files
git/compat
Johannes Sixt 1e52e22d9e Windows: Work around intermittent failures in mingw_rename
We have replaced rename() with a version that can rename a file to a
destination that already exists. Nevertheless, many users, the author
included, observe failures in the code that are not reproducible.

The theory is that the failures are due to some other process that happens
to have opened the destination file briefly at the wrong moment. (And there
is no way on Windows to delete or replace a file that is currently open.)
One such process could be Windows Explorer that is updating its directory
listing because it detected a change in the .git directory or a virus
scanner. The failure is more often observed while there is heavy git
activity (for example while the test suite is running or during a rebase
operation).

We work around the failure by retrying the rename operation if it failed
due to ERROR_ACCESS_DENIED. The retries are delayed a bit: The first only
by giving up the time slice, the next after the minimal scheduling
granularity, and if more retries are needed, then we wait some non-trivial
amount of time with exponential back-off.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-04-03 09:45:16 +02:00
..
2008-09-30 14:30:06 -07:00
2009-03-02 18:28:06 -08:00
2009-03-18 19:23:04 -07:00
2007-06-07 00:04:01 -07:00
2009-03-18 19:23:04 -07:00