From: Eric Wong Date: Sat, 25 Mar 2023 11:11:05 +0000 (+0000) Subject: lei_store: avoid redundant work on no-op worker spawn X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2021c73236b0c7d9f4e6ad90291c35138c9ef75e;p=thirdparty%2Fpublic-inbox.git lei_store: avoid redundant work on no-op worker spawn 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") --- diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index fce15a724..cf5a03a0e 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: $!";