]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei_store: avoid redundant work on no-op worker spawn
authorEric Wong <e@80x24.org>
Sat, 25 Mar 2023 11:11:05 +0000 (11:11 +0000)
committerEric Wong <e@80x24.org>
Sat, 25 Mar 2023 21:03:50 +0000 (21:03 +0000)
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

index fce15a724b511d15c49a3a2c196eb4d9e68291d7..cf5a03a0e9e351fe6df6085f085c7c766cd7c929 100644 (file)
@@ -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: $!";