git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH] http: use --stdin and --keep when downloading pack
Date: Fri, 22 Feb 2019 00:04:06 -0500	[thread overview]
Message-ID: <20190222050406.GA6050@sigill.intra.peff.net> (raw)
In-Reply-To: <20190221184948.100083-1-jonathantanmy@google.com>

On Thu, Feb 21, 2019 at 10:49:48AM -0800, Jonathan Tan wrote:

> > > -	if (finalize_object_file(preq->tmpfile.buf, sha1_pack_name(p->sha1))
> > > -	 || finalize_object_file(tmp_idx, sha1_pack_index_name(p->sha1))) {
> > > -		free(tmp_idx);
> > > -		return -1;
> > > +	if (finish_command(&ip)) {
> > > +		ret = -1;
> > > +		goto cleanup;
> > >  	}
> > 
> > If the command fails but we got something in *lockfile, should we clean
> > it up? Likewise, do we need to be installing a signal handler to clean
> > it up in case we die in other code paths (or by a signal)?
> 
> My inclination is not to do it - as far as I can tell, we don't have
> cleanup or signal handlers in fetch-pack.c either.

Hmm, yeah, you're right. Nor do we do it on fetch. At first I was
surprised that this doesn't cause more problems (we'd leave it in place
after seeing a pre-receive hook fail, for instance), but in practice it
gets cleaned up along with the rest of the quarantine area.

There's still a window where we may leave it around, though (and we
don't quarantine fetches at all), so it might be worth addressing at
some point. But I agree it is totally out of scope for this patch.

-Peff

  reply	other threads:[~2019-02-22  5:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21  0:14 [RFC PATCH] http: use --stdin and --keep when downloading pack Jonathan Tan
2019-02-21 14:08 ` Jeff King
2019-02-21 18:49   ` Jonathan Tan
2019-02-22  5:04     ` Jeff King [this message]
2019-02-21 21:26 ` Junio C Hamano

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=20190222050406.GA6050@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@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).