git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aleksey Midenkov <midenok@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Duy Nguyen <pclouds@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Bug: fatal: Unable to create '.../.git/index.lock': File exists.
Date: Thu, 2 May 2019 16:45:36 +0300	[thread overview]
Message-ID: <CAF8BazAK_s89XY8-AAsSSbgOFgP03CLRZ50bLGPsc89bfnN7kQ@mail.gmail.com> (raw)
In-Reply-To: <20190501183638.GF4109@sigill.intra.peff.net>

On Wed, May 1, 2019 at 9:36 PM Jeff King <peff@peff.net> wrote:
>
> On Wed, May 01, 2019 at 10:15:19AM +0300, Aleksey Midenkov wrote:
>
> > > Usually when we see racy contention on index.lock, the culprit turns out
> > > to be another unrelated git process refreshing the index. Do you have
> > > anything else running which might be using "git status" (e.g., magit in
> > > emacs, vim git integration, etc)?
> >
> > kdevelop which is git-aware. But if git fails on concurrent operation
> > this is still not good. I would expect it to wait until lock releases
> > for some time.
>
> Historically Git does not wait for locks because whoever is holding the
> lock is likely to invalidate the changes we're proposing to make by
> taking the lock in the first place. We've softened on that a bit in
> recent years (e.g., ref updates now retry with a timeout to accommodate
> things like reflog pruning), but I don't think the index code does.
>
> If the other entity holding the lock is just updating the stat
> information in the index, that's probably OK. If it's actually
> manipulating the index, I think we'd have to give more thought about
> whether that's safe.
>
> Assuming that kdevelop is just running "git status" in the background,
> though, there's an easier solution. If it uses "git --no-optional-locks
> status" instead, that will instruct it not to take the index lock at
> all.

And can we disable optional locks at git configuration level? Because
changing source code of each application that is not aware of this
option is not an easier solution.

>
> -Peff



-- 
All the best,

Aleksey Midenkov
@midenok

  reply	other threads:[~2019-05-02 13:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAF8BazDu_GqoCPBQ-gEJ+q8n1aWSjf_TOV7bDE5VCQkDgBjyfQ@mail.gmail.com>
2019-04-29 11:02 ` Bug: fatal: Unable to create '.../.git/index.lock': File exists Aleksey Midenkov
2019-04-29 11:34   ` Duy Nguyen
2019-04-30 11:19     ` Aleksey Midenkov
2019-04-30 17:41       ` Jeff King
2019-05-01  7:15         ` Aleksey Midenkov
2019-05-01 18:36           ` Jeff King
2019-05-02 13:45             ` Aleksey Midenkov [this message]
2019-05-02 15:07               ` Jeff King
2019-05-02 16:38                 ` Duy Nguyen
2019-05-02 16:58                   ` Jeff King
2019-05-02 17:24                     ` Duy Nguyen
2019-05-03  9:47                       ` Johannes Schindelin
2019-05-03 10:22                         ` Duy Nguyen
2019-05-03  5:42                     ` Duy Nguyen
2019-04-29 21:10   ` Johannes Schindelin

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=CAF8BazAK_s89XY8-AAsSSbgOFgP03CLRZ50bLGPsc89bfnN7kQ@mail.gmail.com \
    --to=midenok@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /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).