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 AA3781FA5F for ; Wed, 25 Oct 2023 00:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1698193793; bh=Qh/ZzOui/M/ok797hbw0GoD4tDESgR1AmjUNTnNsh70=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Uxtsf11F7Jq4vOr8vOKGl6PaWjBsyEXLVRs1ruQn7mzWi08XCiZHPkI74e7fiEdtE HLYDuIiXqrT8Zh7gDvA5pXpsAVHWvdO8q/NHWFpZS7J4p/b6BZjEXYSaQ0ACALUGns lI4en+N7ozmGCozH2ISbDM15zcHop94SbLrx7akA= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 24/26] cindex: drop XH_PID global Date: Wed, 25 Oct 2023 00:29:47 +0000 Message-ID: <20231025002949.3092193-25-e@80x24.org> In-Reply-To: <20231025002949.3092193-1-e@80x24.org> References: <20231025002949.3092193-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We only the PID locally to call awaitpid. --- lib/PublicInbox/CodeSearchIdx.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index 68b47d02..2356164b 100644 --- a/lib/PublicInbox/CodeSearchIdx.pm +++ b/lib/PublicInbox/CodeSearchIdx.pm @@ -74,7 +74,6 @@ our ( $PRUNE_DONE, # marks off prune completions $NCHANGE, # current number of changes $NPROC, - $XH_PID, # XapHelper PID $XHC, # XapClient $REPO_CTX, # current repo being indexed in shards $IDX_TODO, # [ $git0, $root0, $git1, $root1, ...] @@ -514,8 +513,8 @@ sub assoc_max_init ($) { sub dump_roots_start { my ($self, $associate) = @_; - ($XHC, $XH_PID) = PublicInbox::XapClient::start_helper("-j$NPROC"); - awaitpid($XH_PID, \&cmd_done, ['xap_helper', "-j$NPROC"]); + ($XHC, my $pid) = PublicInbox::XapClient::start_helper("-j$NPROC"); + awaitpid($pid, \&cmd_done, ['xap_helper', "-j$NPROC"]); $associate // die 'BUG: no $associate'; $TODO{associating} = 1; # keep shards_active() happy progress($self, 'dumping IDs from coderepos'); @@ -1113,7 +1112,7 @@ sub cidx_run { # main entry point local ($DO_QUIT, $REINDEX, $TXN_BYTES, @GIT_DIR_GONE, @PRUNE_QUEUE, $REPO_CTX, %ALT_FH, $TMPDIR, @AWK, @COMM, $CMD_ENV, %TODO, @IBXQ, @IBX, @JOIN, @ASSOC_PFX, $DUMP_IBX_WPIPE, - @ID2ROOT, $XH_PID, $XHC, @SORT); + @ID2ROOT, $XHC, @SORT); local $BATCH_BYTES = $self->{-opt}->{batch_size} // $PublicInbox::SearchIdx::BATCH_BYTES; local $self->{ASSOC_PFX} = \@ASSOC_PFX;