Skip to content

Commit

Permalink
git-svn: ignore SIGPIPE
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roman Kagan authored and Eric Wong committed Apr 24, 2012
1 parent 037a98c commit 6ade9bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
$| = 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;
Expand Down

0 comments on commit 6ade9bd

Please sign in to comment.