From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id DC90C1F424 for ; Fri, 30 Mar 2018 01:20:48 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 1/9] search: warn on reopens and die on total failure Date: Fri, 30 Mar 2018 01:20:40 +0000 Message-Id: <20180330012048.15985-2-e@80x24.org> In-Reply-To: <20180330012048.15985-1-e@80x24.org> References: <20180330012048.15985-1-e@80x24.org> List-Id: -watch on a busy/giant Maildir caused too many Xapian errors while attempting to browse. --- lib/PublicInbox/Search.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 5fc7682..de296e1 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -215,18 +215,20 @@ sub get_thread { sub retry_reopen { my ($self, $cb) = @_; my $ret; - for (1..10) { + for my $i (1..10) { eval { $ret = $cb->() }; return $ret unless $@; # Exception: The revision being read has been discarded - # you should call Xapian::Database::reopen() if (ref($@) eq 'Search::Xapian::DatabaseModifiedError') { + warn "reopen try #$i on $@\n"; reopen($self); } else { warn "ref: ", ref($@), "\n"; die; } } + die "Too many Xapian database modifications in progress\n"; } sub _do_enquire { -- EW