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,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 1C2C71F55F for ; Fri, 1 Sep 2023 20:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1693601391; bh=IahS2LMxU8XxnIScHVx3faO7QgqswlDHe4szw62Q2/Q=; h=From:To:Subject:Date:From; b=QykkfgLT+yamqkYGmpKBK4v0HtNt685soARPMGmdq/ycQu4vMQTtDy+IV44eYSpbC +Q8Sxitz7BwyOCh5ggDXvyepTBeW9ru91hTpjpKqnno2VdPdwuiAyg3vp6T1wK0BKx NEegaxkVlEiA3P5m9QJlY+qjee0gB/dwJyuBOo/E= From: Eric Wong To: spew@80x24.org Subject: [PATCH 1/2] test_common: block signals on start_script Date: Fri, 1 Sep 2023 20:49:49 +0000 Message-ID: <20230901204950.1615894-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- lib/PublicInbox/TestCommon.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 6da993af..ec051b57 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -473,7 +473,14 @@ sub start_script { } $tail = tail_f(@paths); } - my $pid = fork // die "fork: $!\n"; + my $fset = POSIX::SigSet->new; + my $oset = POSIX::SigSet->new; + $fset->fillset or die "fillset: $!"; + PublicInbox::DS::sig_setmask($fset, $oset); + require PublicInbox::OnDestroy; + my $restore = PublicInbox::OnDestroy->new($$, + \&PublicInbox::DS::sig_setmask, $oset); + my $pid = fork // die "fork: $!"; if ($pid == 0) { eval { PublicInbox::DS->Reset }; for (@{delete($opt->{-CLOFORK}) // []}) { @@ -508,6 +515,7 @@ sub start_script { die "FAIL: ",join(' ', $key, @argv), ": $!\n"; } } + undef $restore; require PublicInbox::AutoReap; my $td = PublicInbox::AutoReap->new($pid); $td->{-extra} = $tail;