From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9F8F91F428 for ; Sat, 25 Mar 2023 11:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1679742665; bh=5qPfA4M2MiqoWuKojsTSjMh8gdiqSeLCTrb3lsMiygY=; h=From:To:Subject:Date:From; b=nmY0h+p+7GyOamfGDmwGxnJYrnGxxnkWvrgQWpYRMOiH107+C4IaaavGQzHZekVyx 9ooBy8lZaSwo+u/8JkNzHliUqimaLkqgJpF/73vHPUyhSCvkjuDs/719lq2FQ22ttE GkYcuggm/Lx2vTquIVfiUBipLhjq2u2TmfKTTMU4= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei_store: avoid redundant work on no-op worker spawn Date: Sat, 25 Mar 2023 11:11:05 +0000 Message-Id: <20230325111105.81455-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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: $!";