]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
v2writable: done: force synchronous awaitpid
authorEric Wong <e@80x24.org>
Tue, 19 Nov 2024 21:47:52 +0000 (21:47 +0000)
committerEric Wong <e@80x24.org>
Wed, 20 Nov 2024 17:40:20 +0000 (17:40 +0000)
We need to shut down shards synchronously to reliably release
the inbox write lock when inside the DS event loop (as the
lei/store subprocess is, unlike most v2writable users).

This seems to fix long-running `lei import' failures to
lei/store after repeated tests.  It is a good idea anyways to
ensure exit status of shard workers are correct before returning
from ->done.

lib/PublicInbox/V2Writable.pm

index 721fbb4a0aea513d34adac135832b46585052752..9f686bfacf1bae316d5fd7bab96d0b33f457b0f1 100644 (file)
@@ -579,6 +579,7 @@ sub active { !!$_[0]->{im} }
 # public
 sub done {
        my ($self) = @_;
+       local $PublicInbox::DS::in_loop; # sync awaitpid in shard_close
        my $err = '';
        if (my $im = delete $self->{im}) {
                eval { $im->done }; # PublicInbox::Import::done