From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 4/5] fetch-pack: isolate sigpipe in demuxer thread
Date: Tue, 19 Apr 2016 18:50:29 -0400 [thread overview]
Message-ID: <20160419225029.GD18255@sigill.intra.peff.net> (raw)
In-Reply-To: <20160419223945.GA18055@sigill.intra.peff.net>
In commit 9ff18fa (fetch-pack: ignore SIGPIPE in sideband
demuxer, 2016-02-24), we started using sigchain_push() to
ignore SIGPIPE in the async demuxer thread. However, this is
rather clumsy, as it ignores SIGPIPE for the entire process,
including the main thread. At the time we didn't have any
per-thread signal support, but we now we do. Let's use it.
Signed-off-by: Jeff King <peff@peff.net>
---
fetch-pack.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index f96f6df..b501d5c 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -15,7 +15,6 @@
#include "version.h"
#include "prio-queue.h"
#include "sha1-array.h"
-#include "sigchain.h"
static int transfer_unpack_limit = -1;
static int fetch_unpack_limit = -1;
@@ -674,10 +673,8 @@ static int sideband_demux(int in, int out, void *data)
int *xd = data;
int ret;
- sigchain_push(SIGPIPE, SIG_IGN);
ret = recv_sideband("fetch-pack", xd[0], out);
close(out);
- sigchain_pop(SIGPIPE);
return ret;
}
@@ -701,6 +698,7 @@ static int get_pack(struct fetch_pack_args *args,
demux.proc = sideband_demux;
demux.data = xd;
demux.out = -1;
+ demux.isolate_sigpipe = 1;
if (start_async(&demux))
die("fetch-pack: unable to fork off sideband"
" demultiplexer");
--
2.8.1.512.g4e0a533
next prev parent reply other threads:[~2016-04-19 22:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-19 22:39 [PATCH 0/5] fix deadlock in git-push Jeff King
2016-04-19 22:45 ` [PATCH 1/5] send-pack: close demux pipe before finishing async process Jeff King
2016-04-19 22:49 ` [PATCH 2/5] run-command: teach async threads to ignore SIGPIPE Jeff King
2016-04-21 5:15 ` Johannes Sixt
2016-04-21 5:18 ` Jeff King
2016-04-19 22:50 ` [PATCH 3/5] send-pack: isolate sigpipe in demuxer thread Jeff King
2016-04-19 22:50 ` Jeff King [this message]
2016-04-19 22:51 ` [PATCH 5/5] t5504: drop sigpipe=ok from push tests Jeff King
2016-04-20 21:17 ` [PATCH 0/5] fix deadlock in git-push Junio C Hamano
2016-04-20 21:51 ` Jeff King
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=20160419225029.GD18255@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
/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).