From: Eric Wong Date: Tue, 19 Nov 2024 21:47:52 +0000 (+0000) Subject: v2writable: done: force synchronous awaitpid X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99fc3d76;p=thirdparty%2Fpublic-inbox.git v2writable: done: force synchronous awaitpid 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. --- diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 721fbb4a0..9f686bfac 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -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