]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: warn on reopens and die on total failure
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Fri, 30 Mar 2018 01:20:40 +0000 (01:20 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Fri, 30 Mar 2018 01:20:59 +0000 (01:20 +0000)
-watch on a busy/giant Maildir caused too many Xapian
errors while attempting to browse.

lib/PublicInbox/Search.pm

index 5fc7682c99c72e9a3a46a157f68483622932587d..de296e1a73a4341daff3bd7e55b1c6a1e28be60f 100644 (file)
@@ -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 {