From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Nate Parsons <parsons.nate@gmail.com>, git@vger.kernel.org
Subject: Re: git .lock file error
Date: Thu, 30 Sep 2010 13:15:23 -0700 [thread overview]
Message-ID: <7vbp7fhtt0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <AANLkTik364t7WEHOsZcB7FE4Y2gJQNxkXsRvW5guUWCi@mail.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Thu\, 30 Sep 2010 19\:13\:02 +0000")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> On Thu, Sep 30, 2010 at 18:00, Nate Parsons <parsons.nate@gmail.com> 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?
next prev parent reply other threads:[~2010-09-30 20:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-13 15:19 git .lock file error Nate Parsons
2010-09-20 2:42 ` Nate Parsons
2010-09-30 18:00 ` Nate Parsons
2010-09-30 19:13 ` Ævar Arnfjörð Bjarmason
2010-09-30 20:15 ` Junio C Hamano [this message]
2010-09-30 21:10 ` Nate Parsons
2010-09-30 21:16 ` Ævar Arnfjörð Bjarmason
2010-09-30 23:45 ` Erik Faye-Lund
2010-10-01 0:57 ` Nate Parsons
[not found] ` <AANLkTik2HtyVGz6xFb_VmCh1gSAA_vwpUXhytHFzgCwa@mail.gmail.com>
2010-10-01 1:59 ` Erik Faye-Lund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vbp7fhtt0.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=parsons.nate@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).