user/dev discussion of public-inbox itself
 help / color / Atom feed
* [PATCH] zombie-fix
@ 2020-06-29  8:46 Eric Wong
  2020-06-29  8:47 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2020-06-29  8:46 UTC (permalink / raw)
  To: meta

---
 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);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] zombie-fix
  2020-06-29  8:46 [PATCH] zombie-fix Eric Wong
@ 2020-06-29  8:47 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2020-06-29  8:47 UTC (permalink / raw)
  To: meta

Oops, missent barely tested patch :x.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29  8:46 [PATCH] zombie-fix Eric Wong
2020-06-29  8:47 ` Eric Wong

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