diff options
author | Eric Wong <e@80x24.org> | 2016-08-09 00:41:37 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-08-09 00:42:19 +0000 |
commit | 200fb98dd5d5f81344e9ab732d2c7ee3f92203e1 (patch) | |
tree | c0c16b3435aa08fb5621e72de3f7542338213c08 /lib/PublicInbox/Git.pm | |
parent | 3713c727cda431a0dc2865a7878c13ecf9f21851 (diff) | |
download | public-inbox-200fb98dd5d5f81344e9ab732d2c7ee3f92203e1.tar.gz |
We must ensure cat-file process is launched before Xapian grabs lock, too. Our use of "git cat-file --batch" has the same problem as "git log" did, (which was fixed in commit 3713c727cda431a0dc2865a7878c13ecf9f21851) "searchidx: release Xapian FDs before spawning git log"
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r-- | lib/PublicInbox/Git.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index f47bc439..59c27470 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -39,7 +39,7 @@ sub _bidi_pipe { sub cat_file { my ($self, $obj, $ref) = @_; - $self->_bidi_pipe(qw(--batch in out pid)); + batch_prepare($self); $self->{out}->print($obj, "\n") or fail($self, "write error: $!"); my $in = $self->{in}; @@ -89,6 +89,8 @@ sub cat_file { $rv; } +sub batch_prepare ($) { _bidi_pipe($_[0], qw(--batch in out pid)) } + sub check { my ($self, $obj) = @_; $self->_bidi_pipe(qw(--batch-check in_c out_c pid_c)); |