From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 3/3] v2writable: done: force synchronous awaitpid
Date: Tue, 19 Nov 2024 21:47:52 +0000 [thread overview]
Message-ID: <20241119214752.1883670-4-e@80x24.org> (raw)
In-Reply-To: <20241119214752.1883670-1-e@80x24.org>
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).
While more testing is being conducted, this seems to fix
long-running `lei import' failures to lei/store. It seems like
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 721fbb4a..9f686bfa 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
next prev parent reply other threads:[~2024-11-19 21:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 21:47 [PATCH 0/3] write-related fixes Eric Wong
2024-11-19 21:47 ` [PATCH 1/3] v2writable: use DS and import now() sub Eric Wong
2024-11-19 21:47 ` [PATCH 2/3] treewide: warn on SQLite `PRAGMA optimize' failure Eric Wong
2024-11-19 21:47 ` Eric Wong [this message]
2024-11-20 19:06 ` [PATCH 3/3] v2writable: done: force synchronous awaitpid Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241119214752.1883670-4-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).