From ede63a345dfa0254e319650baafc7d341ef7a925 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 19 Aug 2022 09:07:42 +0000 Subject: [PATCH] lei reindex: account for parallel lei/store users We need to call eidx_init in each git->cat_async callback since another requestor may've stopped the shard processes. --- lib/PublicInbox/LeiStore.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 277ed6bd..8e710540 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -337,7 +337,8 @@ sub _docids_and_maybe_kw ($$) { sub _reindex_1 { # git->cat_async callback my ($bref, $hex, $type, $size, $smsg) = @_; - my ($self, $eidx, $tl) = delete @$smsg{qw(-self -eidx -tl)}; + my $self = delete $smsg->{-sto}; + my ($eidx, $tl) = eidx_init($self); $bref //= _lms_rw($self)->local_blob($hex, 1); if ($bref) { my $eml = PublicInbox::Eml->new($bref); @@ -353,7 +354,7 @@ sub reindex_art { my ($eidx, $tl) = eidx_init($self); my $smsg = $eidx->{oidx}->get_art($art) // return; return if $smsg->{bytes} == 0; # external-only message - @$smsg{qw(-self -eidx -tl)} = ($self, $eidx, $tl); + $smsg->{-sto} = $self; $eidx->git->cat_async($smsg->{blob} // die("no blob (#$art)"), \&_reindex_1, $smsg); } -- 2.44.0