From: Jeff King <peff@peff.net>
To: Stefan Beller <sbeller@google.com>
Cc: "Martin Ågren" <martin.agren@gmail.com>,
gitgitgadget@gmail.com, git <git@vger.kernel.org>,
"Junio C Hamano" <gitster@pobox.com>,
"Gaël Lhez" <gael.lhez@gmail.com>
Subject: Re: [PATCH v2 1/1] bundle: cleanup lock files on error
Date: Wed, 14 Nov 2018 23:34:09 -0500 [thread overview]
Message-ID: <20181115043409.GA3419@sigill.intra.peff.net> (raw)
In-Reply-To: <CAGZ79kZ_wrQ=OdJ6xWbL+F5RDb38YAmzc87o8A=Zb8zBywMJBQ@mail.gmail.com>
On Wed, Nov 14, 2018 at 02:08:48PM -0800, Stefan Beller wrote:
> On Wed, Nov 14, 2018 at 1:43 PM Martin Ågren <martin.agren@gmail.com> wrote:
> >
> > On Wed, 14 Nov 2018 at 16:26, Gaël Lhez via GitGitGadget
> > <gitgitgadget@gmail.com> wrote:
> > > However, the `.lock` file was still open and on Windows that means
> > > that it could not be deleted properly. This patch fixes that issue.
> >
> > Hmmm, doesn't the tempfile machinery remove the lock file when we die?
>
> On Windows this seems not to be the case. (Open files cannot be deleted
> as the open file is not kept by inode or similar but by the file path there?)
>
> Rewording your concern: Could the tempfile machinery be taught to
> work properly on Windows, e.g. by first closing all files and then deleting
> them afterwards?
It already tries to do so. See delete_tempfile(), or more likely in the
die() case, the remove_tempfiles() handler which is called at exit.
Are we sure this is still a problem?
I looked at the test to see if it would pass, but it is not even
checking anything about lockfiles! It just checks that we exit 1 by
returning up the callstack instead of calling die(). And of course it
would not have a problem under Linux either way. But if I run something
similar under strace, I see:
$ strace ./git bundle create foobar.bundle HEAD..HEAD
[...]
openat(AT_FDCWD, "/home/peff/compile/git/foobar.bundle.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 3
[...]
close(3) = 0
unlink("/home/peff/compile/git/foobar.bundle.lock") = 0
exit_group(128) = ?
which seems right.
-Peff
next prev parent reply other threads:[~2018-11-15 4:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 15:09 [PATCH 0/1] bundle: fix issue when bundles would be empty Johannes Schindelin via GitGitGadget
2018-11-13 15:09 ` [PATCH 1/1] bundle: refuse to create empty bundle Gaël Lhez via GitGitGadget
2018-11-13 19:28 ` Stefan Beller
2018-11-13 20:37 ` Gaël Lhez
[not found] ` <CAK8L4uiMHrsdwJz9+rD1tSCywL2kHosx-hKZdS=UtZDHLy464A@mail.gmail.com>
2018-11-13 21:11 ` Stefan Beller
2018-11-14 15:23 ` Johannes Schindelin
2018-11-14 15:25 ` [PATCH v2 0/1] bundle: fix issue when bundles would be empty Johannes Schindelin via GitGitGadget
2018-11-14 15:25 ` [PATCH v2 1/1] bundle: cleanup lock files on error Gaël Lhez via GitGitGadget
2018-11-14 21:43 ` Martin Ågren
2018-11-14 22:08 ` Stefan Beller
2018-11-15 4:34 ` Jeff King [this message]
2018-11-15 12:57 ` Johannes Schindelin
2018-11-15 13:37 ` Jeff King
2018-11-15 16:32 ` Johannes Schindelin
2018-11-15 16:43 ` Jeff King
2018-11-15 20:01 ` Johannes Schindelin
2018-11-16 9:43 ` [PATCH] bundle: dup() output descriptor closer to point-of-use Jeff King
2018-11-16 15:06 ` Johannes Schindelin
2018-11-17 7:05 ` Junio C Hamano
2018-11-15 16:49 ` [PATCH v2 1/1] bundle: cleanup lock files on error Duy Nguyen
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=20181115043409.GA3419@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=gael.lhez@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=martin.agren@gmail.com \
--cc=sbeller@google.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).