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-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 7D11B1F5AE for ; Mon, 29 Jun 2020 08:46:37 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] zombie-fix Date: Mon, 29 Jun 2020 08:46:37 +0000 Message-Id: <20200629084637.25958-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- lib/PublicInbox/WatchMaildir.pm | 8 +++++--- script/public-inbox-watch | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index ec28a3034ff..95a9b256b12 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -123,9 +123,10 @@ sub new { sub _done_for_now { my ($self) = @_; - my $importers = $self->{importers}; - foreach my $im (values %$importers) { + my $sigfd = $self->{sigfd}; + foreach my $im (values %{$self->{importers}}) { $im->done; + $sigfd->event_step if $sigfd; # check signals } } @@ -910,9 +911,10 @@ sub watch_nntp_init ($$) { } sub watch { - my ($self, $sig, $oldset) = @_; + my ($self, $sig, $oldset, $sigfd) = @_; $self->{oldset} = $oldset; $self->{sig} = $sig; + $self->{sigfd} = $sigfd; my $poll = {}; # intvl_seconds => [ url1, url2 ] watch_imap_init($self, $poll) if $self->{imap}; watch_nntp_init($self, $poll) if $self->{nntp}; diff --git a/script/public-inbox-watch b/script/public-inbox-watch index c07d45d74ae..8f0200688ed 100755 --- a/script/public-inbox-watch +++ b/script/public-inbox-watch @@ -41,5 +41,5 @@ if ($watch_md) { PublicInbox::Sigfd::set_sigmask($oldset); PublicInbox::DS->SetLoopTimeout(1000); } - $watch_md->watch($sig, $oldset) while ($watch_md); + $watch_md->watch($sig, $oldset, $sigfd) while ($watch_md); }