Re: git .lock file error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ãvar ArnfjÃrà Bjarmason <avarab@xxxxxxxxx> writes:

> On Thu, Sep 30, 2010 at 18:00, Nate Parsons <parsons.nate@xxxxxxxxx> wrote:
>> OK, so this is definitely a win32 issue. I believe that the perl
>> script is simply creating .lock files too fast for Windows to keep up.
>> Simply trying again fixes the problem for me.
>
> Sounds like something that might do with a non-hacky solution, but I
> don't know what that would be.
>
> ...
> FWIW I think this is more readable, but maybe we want to retry on all
> platforms:
>
>     my $fh;
>     if ($^O eq 'MSWin32' or $^O eq 'cygwin') {
>         # Try 10 times to open our lock file, in case Windows is lagging
>         for my $try (1..10) {
>             sysopen($fh, $db_lock, O_RDWR | O_CREAT);
>             last if $fh;
>         }
>     } else {
>         sysopen($fh, $db_lock, O_RDWR | O_CREAT);
>     }

What exactly does "Windows is lagging" mean in the above?

Why does sysopen() randomly fail and why does it succeed (sometimes) when
it immediately gets retried with the same argument?  Is this a shared lock
and is used by some other processes that drive git?  Why does the issue
manifest only on Windows?  If there are competing processes, wouldn't it
exacerbate the situation to run a tight loop to try grabbing the lock
without waiting, like the above patch does?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]