Skip to content

Commit 6ade9bd

Browse files
rvkaEric Wong
authored andcommitted
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 <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent 037a98c commit 6ade9bd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

git-svn.perl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
$| = 1; # unbuffer STDOUT
3737

3838
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+
3944
sub _req_svn {
4045
require SVN::Core; # use()-ing this causes segfaults for me... *shrug*
4146
require SVN::Ra;

0 commit comments

Comments
 (0)