git-svn: ignore SIGPIPE

In HTTP with keep-alive it's not uncommon for the client to notice that the server decided to stop maintaining the current connection only when sending a new request. This naturally results in -EPIPE and possibly SIGPIPE. The subversion library itself makes no provision for SIGPIPE. Some combinations of the underlying libraries do (typically SIG_IGN-ing it), some don't. Presumably for that reason all subversion commands set SIGPIPE to SIG_IGN early in their main()-s. So should we. This, together with the previous patch, fixes the notorious "git-svn died of signal 13" problem (see e.g. http://thread.gmane.org/gmane.comp.version-control.git/134936). Signed-off-by: Roman Kagan <rkagan@mail.ru> Acked-by: Eric Wong <normalperson@yhbt.net>

Roman Kagan committed Apr 2, 2012 at 17:52 UTC 6ade9bdadaf61565ee4e2ab47f66baaf41a20ecf
1 file changed +5
git-svn.perl
+5
@@ -36,6 +36,11 @@ $ENV{TZ} = 'UTC';
36 $| = 1; # unbuffer STDOUT
37
38 sub fatal (@) { print STDERR "@_\n"; exit 1 }
39 +
40 +# All SVN commands do it. Otherwise we may die on SIGPIPE when the remote
41 +# repository decides to close the connection which we expect to be kept alive.
42 +$SIG{PIPE} = 'IGNORE';
43 +
44 sub _req_svn {
45 require SVN::Core; # use()-ing this causes segfaults for me... *shrug*
46 require SVN::Ra;