From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1667F1F670 for ; Fri, 15 Oct 2021 13:45:26 +0000 (UTC) Date: Fri, 15 Oct 2021 13:45:25 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [SQUASH PATCH 4/3] lei q: ensure all workers die on Ctrl-C Message-ID: <20211015134525.GA7887@dcvr> References: <20211015133056.6845-1-e@80x24.org> <20211015133056.6845-3-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211015133056.6845-3-e@80x24.org> List-Id: We never handled v2:// writers properly before. And we still need to kill the entire process group of each worker :x Oops --- lib/PublicInbox/LEI.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 4a1f1652..83534878 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -455,11 +455,14 @@ my %CONFIG_KEYS = ( 'leistore.dir' => 'top-level storage location', ); -my @WQ_KEYS = qw(lxs l2m ikw pmd wq1 lne); # internal workers +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->DESTROY } + for my $wq (grep(defined, delete(@$self{@WQ_KEYS}))) { + $wq->wq_kill('-TERM'); + $wq->DESTROY; + } } # pronounced "exit": x_it(1 << 8) => exit(1); x_it(13) => SIGPIPE