diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-04-29 19:59:08 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-29 19:59:08 (GMT) |
commit | d689301043f6dc14d71e7d33e1b8ea600ae1b67b (patch) | |
tree | de02603666c3fee3c3c1f93b826c27d020d40f1c /send-pack.c | |
parent | 60b3e9b959f4423f6927ef77e7097bea3ad24e45 (diff) | |
parent | c4b27511ab0e3ec464e3fd3d4711251a17b1f733 (diff) | |
download | git-d689301043f6dc14d71e7d33e1b8ea600ae1b67b.zip git-d689301043f6dc14d71e7d33e1b8ea600ae1b67b.tar.gz git-d689301043f6dc14d71e7d33e1b8ea600ae1b67b.tar.bz2 |
Merge branch 'jk/push-client-deadlock-fix'
"git push" from a corrupt repository that attempts to push a large
number of refs deadlocked; the thread to relay rejection notices
for these ref updates blocked on writing them to the main thread,
after the main thread at the receiving end notices that the push
failed and decides not to read these notices and return a failure.
* jk/push-client-deadlock-fix:
t5504: drop sigpipe=ok from push tests
fetch-pack: isolate sigpipe in demuxer thread
send-pack: isolate sigpipe in demuxer thread
run-command: teach async threads to ignore SIGPIPE
send-pack: close demux pipe before finishing async process
Diffstat (limited to 'send-pack.c')
-rw-r--r-- | send-pack.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/send-pack.c b/send-pack.c index 047bd18..37ee04e 100644 --- a/send-pack.c +++ b/send-pack.c @@ -518,6 +518,7 @@ int send_pack(struct send_pack_args *args, demux.proc = sideband_demux; demux.data = fd; demux.out = -1; + demux.isolate_sigpipe = 1; if (start_async(&demux)) die("send-pack: unable to fork off sideband demultiplexer"); in = demux.out; @@ -531,8 +532,10 @@ int send_pack(struct send_pack_args *args, close(out); if (git_connection_is_socket(conn)) shutdown(fd[0], SHUT_WR); - if (use_sideband) + if (use_sideband) { + close(demux.out); finish_async(&demux); + } fd[1] = -1; return -1; } @@ -551,11 +554,11 @@ int send_pack(struct send_pack_args *args, packet_flush(out); if (use_sideband && cmds_sent) { + close(demux.out); if (finish_async(&demux)) { error("error in sideband demultiplexer"); ret = -1; } - close(demux.out); } if (ret < 0) |