From ebc3f825c1eb95399c575fff816180a6e4fffeb6 Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Thu, 22 Feb 2018 21:17:53 +0000 Subject: v2/ui: retry DB reopens in a few more places Relying more on Xapian requires retrying reopens in more places to ensure it does not fall down and show errors to the user. --- lib/PublicInbox/Search.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Search.pm') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index b20b2ccd..1df87d0e 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -185,7 +185,7 @@ sub query { sub get_thread { my ($self, $mid, $opts) = @_; - my $smsg = eval { $self->lookup_skeleton($mid) }; + my $smsg = retry_reopen($self, sub { lookup_skeleton($self, $mid) }); return { total => 0, msgs => [] } unless $smsg; my $qtid = Search::Xapian::Query->new('G' . $smsg->thread_id); @@ -216,6 +216,7 @@ sub retry_reopen { if (ref($@) eq 'Search::Xapian::DatabaseModifiedError') { reopen($self); } else { + warn "ref: ", ref($@), "\n"; die; } } -- cgit v1.2.3-24-ge0c7