From fac2f5b63f0595b67a99784c8a9f9801c1fc9f09 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Jun 2020 10:03:39 +0000 Subject: watch: wire up IMAP IDLE reapers to DS We can avoid synchronous `waitpid(-1, 0)' and save a process when simultaneously watching Maildirs. One DS bug is fixed: ->Reset needs to clear the DS $in_loop flag in forked children so dwaitpid() fails and allows git processes to be reaped synchronously. TestCommon also calls DS->Reset when spawning new processes, since t/imapd.t uses DS->EventLoop while waiting on -watch to write. --- lib/PublicInbox/TestCommon.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/PublicInbox/TestCommon.pm') diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index b252810f..14ebba10 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -350,6 +350,7 @@ sub start_script { } defined(my $pid = fork) or die "fork: $!\n"; if ($pid == 0) { + eval { PublicInbox::DS->Reset }; # pretend to be systemd (cf. sd_listen_fds(3)) # 3 == SD_LISTEN_FDS_START my $fd; -- cgit v1.2.3-24-ge0c7