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-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 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 386111F9FF for ; Fri, 26 Mar 2021 09:51:27 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/4] lei: do not blindly commit to lei/store on close Date: Fri, 26 Mar 2021 09:51:24 +0000 Message-Id: <20210326095126.8184-3-e@80x24.org> In-Reply-To: <20210326095126.8184-1-e@80x24.org> References: <20210326095126.8184-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It may hide errors/bugs, instead do it explicitly for each worker that writes to it. For lei_xsearch, it will be better to close before spawning the MUA for future use since we may need it again once the user starts changing keywords. --- lib/PublicInbox/LEI.pm | 3 --- lib/PublicInbox/LeiXSearch.pm | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 6a5c32b3..59715633 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -1030,9 +1030,6 @@ sub dclose { } } close(delete $self->{1}) if $self->{1}; # may reap_compress - if (my $sto = delete $self->{sto}) { - $sto->ipc_do('done'); - } $self->close if $self->{-event_init_done}; # PublicInbox::DS::close } diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 6410e0ea..b41daffe 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -319,6 +319,7 @@ sub query_done { # EOF callback for main daemon if (my $lxs = delete $lei->{lxs}) { $lxs->wq_wait_old(\&xsearch_done_wait, $lei); } + my $wait = $lei->{sto} ? $lei->{sto}->ipc_do('done') : undef; $lei->{ovv}->ovv_end($lei); if ($l2m) { # close() calls LeiToMail reap_compress if (my $out = delete $lei->{old_1}) {