From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH] zombie-fix
Date: Mon, 29 Jun 2020 08:46:37 +0000 [thread overview]
Message-ID: <20200629084637.25958-1-e@yhbt.net> (raw)
---
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);
}
next reply other threads:[~2020-06-29 8:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-29 8:46 Eric Wong [this message]
2020-06-29 8:47 ` [PATCH] zombie-fix Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200629084637.25958-1-e@yhbt.net \
--to=e@yhbt.net \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).