unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] lei_store: avoid redundant work on no-op worker spawn
@ 2023-03-25 11:11 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-03-25 11:11 UTC (permalink / raw)
  To: meta

While ->wq_workers_start is idempotent, the pipe creation for
PublicInbox::LeiStoreErr was not and required several extra
syscalls and FD allocations.  Check the correct field required
for SOCK_SEQPACKET workers rather than pipe-based workers.

Fixes: cbc2890cb89b81cb ("lei/store: use SOCK_SEQPACKET rather than pipe")
---
 lib/PublicInbox/LeiStore.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index fce15a72..cf5a03a0 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -612,7 +612,7 @@ sub _sto_atexit { # awaitpid cb
 sub write_prepare {
 	my ($self, $lei) = @_;
 	$lei // die 'BUG: $lei not passed';
-	unless ($self->{-ipc_req}) {
+	unless ($self->{-wq_s1}) {
 		my $dir = $lei->store_path;
 		substr($dir, -length('/lei/store'), 10, '');
 		pipe(my ($r, $w)) or die "pipe: $!";

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-25 11:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 11:11 [PATCH] lei_store: avoid redundant work on no-op worker spawn Eric Wong

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).