user/dev discussion of public-inbox itself
 help / Atom feed
* [PATCH] workaround Xapian OFD locks w/o close-on-exec
@ 2018-05-24  8:32 Eric Wong
  0 siblings, 0 replies; 1+ messages in thread
From: Eric Wong @ 2018-05-24  8:32 UTC (permalink / raw)
  To: meta

Xapian v1.2.21..v1.2.24 (inclusive) use OFD locks but failed to
set the close-on-exec flag on those locks.  So we must continue
to work around those old versions by ensuring Xapian file
descriptors aren't held any longer than necessary when in
long-running git processes.

Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
---
 lib/PublicInbox/SearchIdx.pm | 2 ++
 t/convert-compact.t          | 5 ++++-
 t/v2mirror.t                 | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 74f9267..107cd34 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -666,6 +666,7 @@ sub _index_sync {
 
 		$self->{over}->rollback_lazy;
 		$self->{over}->disconnect;
+		$git->cleanup;
 		delete $self->{txn};
 		$xdb->cancel_transaction;
 		$xdb = _xdb_release($self);
@@ -696,6 +697,7 @@ sub _index_sync {
 			}
 		}
 		$self->commit_txn_lazy;
+		$git->cleanup;
 		$xdb = _xdb_release($self);
 		# let another process do some work... <
 		if (!$newest) {
diff --git a/t/convert-compact.t b/t/convert-compact.t
index e923200..def0343 100644
--- a/t/convert-compact.t
+++ b/t/convert-compact.t
@@ -40,7 +40,10 @@ ok($im->add($mime), 'added one message');
 ok($im->remove($mime), 'remove message');
 ok($im->add($mime), 'added message again');
 $im->done;
-PublicInbox::SearchIdx->new($ibx, 1)->index_sync;
+for (1..2) {
+	eval { PublicInbox::SearchIdx->new($ibx, 1)->index_sync; };
+	is($@, '', 'no errors syncing');
+}
 
 is(((stat("$ibx->{mainrepo}/public-inbox"))[2]) & 07777, 0755,
 	'sharedRepository respected for v1');
diff --git a/t/v2mirror.t b/t/v2mirror.t
index 9e0c9e1..4cd369b 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -50,7 +50,7 @@ for my $i (1..9) {
 	$mime->header_set('Subject', "subject = $i");
 	ok($v2w->add($mime), "add msg $i OK");
 }
-$v2w->barrier;
+$v2w->done;
 
 my %opts = (
 	LocalAddr => '127.0.0.1',
-- 
EW


^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24  8:32 [PATCH] workaround Xapian OFD locks w/o close-on-exec Eric Wong

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.org/gmane.mail.public-inbox.general

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox