user/dev discussion of public-inbox itself
 help / color / Atom feed
From: Eric Wong <e@yhbt.net>
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> (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);
 }

             reply index

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 ` 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: https://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

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git