about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiXSearch.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-04-16 20:56:27 +0000
committerEric Wong <e@80x24.org>2024-04-17 09:22:52 +0000
commitcad60b2aa5fee563f2a6b41fa0cc7267e13e4bde (patch)
tree16b82491371a51f2f3879dada0b64a6cce80d613 /lib/PublicInbox/LeiXSearch.pm
parent6b536768f828b12293ecd57ba93ecfa135fc2c77 (diff)
downloadpublic-inbox-cad60b2aa5fee563f2a6b41fa0cc7267e13e4bde.tar.gz
lei: use ->barrier to commit to lei/store
barrier (synchronous checkpoint) is better than ->done with
parallel lei commands being issued (via '&' or different
terminals), since repeatedly stopping and restarting processes
doesn't play nicely with expensive tasks like `lei reindex'.

This introduces a slight regression in maintaining more
processes (and thus resource use) when lei is idle, but that'll
be fixed in the next commit.
Diffstat (limited to 'lib/PublicInbox/LeiXSearch.pm')
-rw-r--r--lib/PublicInbox/LeiXSearch.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm
index d4f34733..5a5a1adc 100644
--- a/lib/PublicInbox/LeiXSearch.pm
+++ b/lib/PublicInbox/LeiXSearch.pm
@@ -363,7 +363,7 @@ print STDERR $_;
                                                 $self, $lei, $each_smsg);
                 };
                 my ($exc, $code) = ($@, $?);
-                $lei->sto_done_request if delete($self->{-sto_imported});
+                $lei->sto_barrier_request if delete($self->{-sto_imported});
                 die "E: $exc" if $exc && !$code;
                 my $nr = delete $lei->{-nr_remote_eml} // 0;
                 if (!$code) { # don't update if no results, maybe MTA is down
@@ -399,7 +399,7 @@ sub query_done { # EOF callback for main daemon
         delete $lei->{lxs};
         ($lei->{opt}->{'mail-sync'} && !$lei->{sto}) and
                 warn "BUG: {sto} missing with --mail-sync";
-        $lei->sto_done_request;
+        $lei->sto_barrier_request;
         $lei->{ovv}->ovv_end($lei);
         if ($l2m) { # close() calls LeiToMail reap_compress
                 $l2m->finish_output($lei);