From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] lei_search: xsmsg_vmd: retry_reopen properly
Date: Mon, 6 Sep 2021 07:20:12 +0000 [thread overview]
Message-ID: <20210906072012.20379-1-e@80x24.org> (raw)
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
reply other threads:[~2021-09-06 7:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210906072012.20379-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).