author | Jeff King <peff@peff.net> | |
Mon, 16 May 2011 06:52:57 +0000 (02:52 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 16 May 2011 23:20:01 +0000 (16:20 -0700) | ||
commit | a1a3fd1f40a67165b849a2a1210ff3a7a2cbcdd6 | |
tree | c600ee91fdf2ad92287db70d1048ee2928fc56d2 | tree | snapshot |
parent | 7ffe853b106680720ddec999e1daf5c186997a1f | commit | diff |
send-pack: avoid deadlock on git:// push with failed pack-objects
Commit 09c9957c fixes a deadlock in which pack-objects
fails, the remote end is still waiting for pack data, and we
are still waiting for the remote end to say something (see
that commit for a much more in-depth explanation).
We solved the problem there by making sure the output pipe
is closed on error; thus the remote sees EOF, and proceeds
to complain and close its end of the connection.
However, in the special case of push over git://, we don't
have a pipe, but rather a full-duplex socket, with another
dup()-ed descriptor in place of the second half of the pipe.
In this case, closing the second descriptor signals nothing
to the remote end, and we still deadlock.
This patch calls shutdown() explicitly to signal EOF to the
other side.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commit 09c9957c fixes a deadlock in which pack-objects
fails, the remote end is still waiting for pack data, and we
are still waiting for the remote end to say something (see
that commit for a much more in-depth explanation).
We solved the problem there by making sure the output pipe
is closed on error; thus the remote sees EOF, and proceeds
to complain and close its end of the connection.
However, in the special case of push over git://, we don't
have a pipe, but rather a full-duplex socket, with another
dup()-ed descriptor in place of the second half of the pipe.
In this case, closing the second descriptor signals nothing
to the remote end, and we still deadlock.
This patch calls shutdown() explicitly to signal EOF to the
other side.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-send-pack.c | diff | blob | history |