From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <e@80x24.org>
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,
	T_SCC_BODY_TEXT_LINE 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 50E1F1F452
	for <meta@public-inbox.org>; Wed, 15 Nov 2023 01:04:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org;
	s=selector1; t=1700010298;
	bh=TskQdXQIoiEkZQngHXHm98xhcLrjEoHf0BW6R69PPJs=;
	h=From:To:Subject:Date:In-Reply-To:References:From;
	b=PCXP5FPj1sGjYFi7nJfJw/IYAkEfpCAYQyGFL1Djxqstb2jXDdf7S6avuKJ0l4GK5
	 i/HhJDPzsNsC5NqT/J5n4dzfXPeKZlFQdgKz3IWbrOi2bPt8OdJCVN5HUnmmAsjJA/
	 SdgupHd81md5jgBBgj7SCzsyr3o+f3DesfFCCkZU=
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 1/2] lei: use -signal numbers for old Perl
Date: Wed, 15 Nov 2023 01:04:56 +0000
Message-Id: <20231115010457.1047199-2-e@80x24.org>
In-Reply-To: <20231115010457.1047199-1-e@80x24.org>
References: <20231115010457.1047199-1-e@80x24.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
List-Id: <meta.public-inbox.org>

Unlike modern Perls, Perl 5.16.3 on CentOS doesn't accept
negative string signals like "-TERM" .

This only became a problem since commit b231d91f42d7
(treewide: enable warnings in all exec-ed processes)
made our code stricter by enabling more warnings.
In both cases, the kill is probably unnecessary and safe
to remove since we can rely on closing sockets to drop
processes.
---
 lib/PublicInbox/LEI.pm        | 2 +-
 lib/PublicInbox/LeiXSearch.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 77acb5a1..69065ce7 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -474,7 +474,7 @@ my @WQ_KEYS = qw(lxs l2m ikw pmd wq1 lne v2w); # internal workers
 sub _drop_wq {
 	my ($self) = @_;
 	for my $wq (grep(defined, delete(@$self{@WQ_KEYS}))) {
-		$wq->wq_kill('-TERM');
+		$wq->wq_kill(-POSIX::SIGTERM());
 		$wq->DESTROY;
 	}
 }
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm
index b09c2462..e85fd3c4 100644
--- a/lib/PublicInbox/LeiXSearch.pm
+++ b/lib/PublicInbox/LeiXSearch.pm
@@ -437,7 +437,7 @@ sub do_post_augment {
 	my $err = $@;
 	if ($err) {
 		if (my $lxs = delete $lei->{lxs}) {
-			$lxs->wq_kill('-TERM');
+			$lxs->wq_kill(-POSIX::SIGTERM());
 			$lxs->wq_close;
 		}
 		$lei->fail("$err");