From 01f2e00be4671e1100b6180310c0fd8c0035ebc8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 15 Jun 2020 07:43:17 +0000 Subject: imap: improve IDLE handling at graceful shutdown Since IMAP IDLE users aren't expected to issue any commands, we can terminate their connections immediately on graceful shutdown. Furthermore, we need to drop the inotify FD from the epoll set to avoid warnings during global destruction. Embarassingly, this required fixing wacky test ordering from 2a717d13f10fcdc6 ("nntpd+imapd: detect replaced over.sqlite3") --- lib/PublicInbox/InboxIdle.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/PublicInbox/InboxIdle.pm') diff --git a/lib/PublicInbox/InboxIdle.pm b/lib/PublicInbox/InboxIdle.pm index d60d4f23..d0bb43c5 100644 --- a/lib/PublicInbox/InboxIdle.pm +++ b/lib/PublicInbox/InboxIdle.pm @@ -79,4 +79,8 @@ sub event_step { warn "$self->{inot}->poll err: $@\n" if $@; } +# for graceful shutdown in PublicInbox::Daemon, +# just ensure the FD gets closed ASAP and subscribers +sub busy { 0 } + 1; -- cgit v1.2.3-24-ge0c7