summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorRoman Kagan <rkagan@mail.ru>2012-04-02 17:52:34 +0400
committerEric Wong <normalperson@yhbt.net>2012-04-24 09:42:08 +0000
commit6ade9bdadaf61565ee4e2ab47f66baaf41a20ecf (patch)
tree0e55745b94a6b25e55b8aa9059538f5a651048d5 /git-svn.perl
parent037a98cd3f3efe85c6f56c4338002e4b2c7afa09 (diff)
downloadgit-6ade9bdadaf61565ee4e2ab47f66baaf41a20ecf.tar.gz
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>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 570504cee7..aa14564e33 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -36,6 +36,11 @@ $ENV{TZ} = 'UTC';
$| = 1; # unbuffer STDOUT
sub fatal (@) { print STDERR "@_\n"; exit 1 }
+
+# All SVN commands do it. Otherwise we may die on SIGPIPE when the remote
+# repository decides to close the connection which we expect to be kept alive.
+$SIG{PIPE} = 'IGNORE';
+
sub _req_svn {
require SVN::Core; # use()-ing this causes segfaults for me... *shrug*
require SVN::Ra;