From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 602691F59D for ; Fri, 19 Aug 2022 09:07:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1660900066; bh=rB0TOG+i0kzkuFNASwADCRxCdJoWQk7KywAd6h7fGU0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mvLtR/BDju+p/tOzcYcDyS2Wx2wZ7k+T5thYzlduy3wyezNOSh+rCbKPjicC9e18C YHOjcMtJhFzA8EjaSC8P53DMsTTVUSExmiuMzxcAqqPtLxnHD9TX4dc2NAee8/HD1o A2QvDnDM/KLCs7YQtGMXYuOW+4FxzqUVWo6eiTZI= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/4] lei reindex: account for parallel lei/store users Date: Fri, 19 Aug 2022 09:07:42 +0000 Message-Id: <20220819090745.4094018-2-e@80x24.org> In-Reply-To: <20220819090745.4094018-1-e@80x24.org> References: <20220819090745.4094018-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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); }