git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Horst Schirmeier <horst@schirmeier.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/6] deadlock regression in v2.11.0 with failed mkdtemp
Date: Tue, 7 Mar 2017 08:50:13 -0500	[thread overview]
Message-ID: <20170307135012.fdk6jhhl4zspdk2v@sigill.intra.peff.net> (raw)
In-Reply-To: <20170307133437.qee2jtynbiwf6uzr@sigill.intra.peff.net>

On Tue, Mar 07, 2017 at 08:34:37AM -0500, Jeff King wrote:

> Yuck. In the original, the error was generated by the child index-pack,
> and we relayed it over the sideband. But we don't even get as far as
> running index-pack in the newer version; we fail trying to make the
> tmpdir. The error ends up in the "unpack" protocol field, but the client
> side does a bad job of showing that. With the rest of the patches, it
> looks like:
> 
>   $ git push ~/tmp/foo.git HEAD
>   Counting objects: 210973, done.
>   Delta compression using up to 8 threads.
>   Compressing objects: 100% (52799/52799), done.
>   error: remote unpack failed: unable to create temporary object directory
>   error: failed to push some refs to '/home/peff/tmp/foo.git'

There are two other options here I should mention.

One is that when pack-objects dies, we suppress the ref-status table
entirely. Which is fair, because it doesn't have anything interesting to
say. But for a case like this where the other side stops reading our
pack early but still produces status reports, we could actually read
them all and have a status table like:

  $ git push ~/tmp/foo.git HEAD
  Counting objects: 209843, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (52186/52186), done.
  error: remote unpack failed: unable to create temporary object directory
  To /home/peff/tmp/foo.git
   ! [remote rejected]     HEAD -> jk/push-index-pack-deadlock (unpacker error)
  error: failed to push some refs to '/home/peff/tmp/foo.git'

We'd have to take some care to make sure we handle the case when the
remote _doesn't_ manage to give us the status (e.g., when there's a
complete hangup). I don't know if it's worth the effort. There's no new
information there.

The second thing is that I think the design of the "unpack <reason>"
report is a bit dated. These days everybody supports the sideband
protocol, so it would probably make more sense to just issue the
"<reason>" report via the sideband (at which point it gets a nice
"remote: " prefix).

We could do something like this:

diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index f2c6953a3..6204d3d00 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1670,6 +1670,8 @@ static const char *unpack(int err_fd, struct shallow_info *si)
 	if (!tmp_objdir) {
 		if (err_fd > 0)
 			close(err_fd);
+		rp_error("unable to create temporary object directory: %s",
+			 strerror(errno));
 		return "unable to create temporary object directory";
 	}
 	child.env = tmp_objdir_env(tmp_objdir);

and drop the "try to show the unpack failure" parts of my series, and
you'd end up with:

  $ git push ~/tmp/foo.git HEAD
  Counting objects: 209843, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (52186/52186), done.
  remote: error: unable to create temporary object directory: Permission denied
  error: failed to push some refs to '/home/peff/tmp/foo.git'

but in cases where pack-objects _doesn't_ fail, existing git versions
do show the "unpack" error. So you'd see it twice.

I don't know if it's worth trying to hack around.

-Peff

  parent reply	other threads:[~2017-03-07 14:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 11:03 regression: git push in non-shared repo stalls (v2.11.0+) Horst Schirmeier
2017-03-07 11:14 ` Horst Schirmeier
2017-03-07 13:34   ` [PATCH 0/6] deadlock regression in v2.11.0 with failed mkdtemp Jeff King
2017-03-07 13:35     ` [PATCH 1/6] receive-pack: fix deadlock when we cannot create tmpdir Jeff King
2017-03-07 13:35     ` [PATCH 2/6] send-pack: extract parsing of "unpack" response Jeff King
2017-03-07 13:36     ` [PATCH 3/6] send-pack: use skip_prefix for parsing unpack status Jeff King
2017-03-07 13:37     ` [PATCH 4/6] send-pack: improve unpack-status error messages Jeff King
2017-03-07 22:56       ` Junio C Hamano
2017-03-08  5:45         ` Jeff King
2017-03-08 17:19           ` Junio C Hamano
2017-03-07 13:38     ` [PATCH 5/6] send-pack: read "unpack" status even on pack-objects failure Jeff King
2017-03-07 13:39     ` [PATCH 6/6] send-pack: report signal death of pack-objects Jeff King
2017-03-07 13:50     ` Jeff King [this message]
2017-03-08 17:58     ` [PATCH 0/6] deadlock regression in v2.11.0 with failed mkdtemp Horst Schirmeier

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170307135012.fdk6jhhl4zspdk2v@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=horst@schirmeier.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).