about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiRemote.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/LeiRemote.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/LeiRemote.pm')
-rw-r--r--lib/PublicInbox/LeiRemote.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiRemote.pm b/lib/PublicInbox/LeiRemote.pm
index ddcaf2c9..d6fc40a4 100644
--- a/lib/PublicInbox/LeiRemote.pm
+++ b/lib/PublicInbox/LeiRemote.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # Make remote externals HTTP(S) inboxes behave like
@@ -51,7 +51,7 @@ sub mset {
         $fh = IO::Uncompress::Gunzip->new($fh, MultiStream=>1, AutoClose=>1);
         eval { PublicInbox::MboxReader->mboxrd($fh, \&each_mboxrd_eml, $self) };
         my $err = $@ ? ": $@" : '';
-        my $wait = $self->{lei}->{sto}->wq_do('done');
+        my $wait = $self->{lei}->{sto}->wq_do('barrier');
         $lei->child_error($?, "@$cmd failed$err") if $err || $?;
         $self; # we are the mset (and $ibx, and $self)
 }