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: $!";

Reply via email to