The deeper eval was preventing retry_reopen from retrying
with readers and writers working in parallel:

  FOO=imaps://example.com/INBOX.huge
  lei lcat $FOO -f mboxcl | lei tag -F mboxcl +L:bar -

Fixes: c7bcfe6cd6648ff0 ("lei: diagnostics for /Document \d+ not found/ errors")
---
 lib/PublicInbox/LeiSearch.pm | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/lib/PublicInbox/LeiSearch.pm b/lib/PublicInbox/LeiSearch.pm
index 47160ed9..a10e6e17 100644
--- a/lib/PublicInbox/LeiSearch.pm
+++ b/lib/PublicInbox/LeiSearch.pm
@@ -55,17 +55,13 @@ sub _xsmsg_vmd { # retry_reopen
        $kw{flagged} = 1 if delete($smsg->{lei_q_tt_flagged});
        my @num = $self->over->blob_exists($smsg->{blob});
        for my $num (@num) { # there should only be one...
-               eval {
-                       $doc = $xdb->get_document(num2docid($self, $num));
-                       $x = xap_terms('K', $doc);
-                       %kw = (%kw, %$x);
-                       if ($want_label) { # JSON/JMAP only
-                               $x = xap_terms('L', $doc);
-                               %L = (%L, %$x);
-                       }
-               };
-               warn "$$ $0 #$num (nshard=$self->{nshard}) $smsg->{blob}: $@"
-                       if $@;
+               $doc = $xdb->get_document(num2docid($self, $num));
+               $x = xap_terms('K', $doc);
+               %kw = (%kw, %$x);
+               if ($want_label) { # JSON/JMAP only
+                       $x = xap_terms('L', $doc);
+                       %L = (%L, %$x);
+               }
        }
        $smsg->{kw} = [ sort keys %kw ] if scalar(keys(%kw));
        $smsg->{L} = [ sort keys %L ] if scalar(keys(%L));
@@ -75,7 +71,8 @@ sub _xsmsg_vmd { # retry_reopen
 sub xsmsg_vmd {
        my ($self, $smsg, $want_label) = @_;
        return if $smsg->{kw}; # already set by LeiXSearch->mitem_kw
-       $self->retry_reopen(\&_xsmsg_vmd, $smsg, $want_label);
+       eval { $self->retry_reopen(\&_xsmsg_vmd, $smsg, $want_label) };
+       warn "$$ $0 (nshard=$self->{nshard}) $smsg->{blob}: $@" if $@;
 }
 
 # when a message has no Message-IDs at all, this is needed for
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to