From 99fc3d76968aacaea55f5b98b5b5a4d2314bc97c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 19 Nov 2024 21:47:52 +0000 Subject: [PATCH] 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. --- lib/PublicInbox/V2Writable.pm | 1 + 1 file changed, 1 insertion(+) 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 -- 2.47.2