From 3713c727cda431a0dc2865a7878c13ecf9f21851 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 9 Aug 2016 00:22:52 +0000 Subject: searchidx: release Xapian FDs before spawning git log This will allow us to release and re-acquire Xapian locks due to the lack of FD_CLOEXEC on some FDs. --- t/search.t | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/search.t b/t/search.t index d5f9d95c..2685348c 100644 --- a/t/search.t +++ b/t/search.t @@ -33,13 +33,14 @@ ok($@, "exception raised on non-existent DB"); } my $rw = PublicInbox::SearchIdx->new($git_dir, 1); -my $ro = PublicInbox::Search->new($git_dir); +$rw->_xdb_acquire; +$rw->_xdb_release; $rw = undef; +my $ro = PublicInbox::Search->new($git_dir); my $rw_commit = sub { - $rw->{xdb}->commit_transaction if $rw; - $rw = undef; + $rw->{xdb}->commit_transaction if $rw && $rw->{xdb}; $rw = PublicInbox::SearchIdx->new($git_dir, 1); - $rw->{xdb}->begin_transaction; + $rw->_xdb_acquire->begin_transaction; }; { -- cgit v1.2.3-24-ge0c7