From d69102cfff67e4308c560c5e8daa8f8a486ff24d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 26 Mar 2021 09:51:24 +0000 Subject: [PATCH] lei: do not blindly commit to lei/store on close 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}) { -- 2.48.1