From 6b941fd4a98be259c9cf4edbb23fe1a01053fab7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 25 Sep 2021 22:38:19 -0700 Subject: lei: ensure refresh_watches isn't called from workers Only the top-level lei-daemon will do inotify/kevent. --- lib/PublicInbox/LEI.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index a337fb0d..8faf74a2 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -578,6 +578,7 @@ sub _lei_atfork_child { close $listener if $listener; undef $listener; $dir_idle->force_close if $dir_idle; + undef $dir_idle; %PATH2CFG = (); $MDIR2CFGPATH = {}; eval 'no warnings; undef $PublicInbox::LeiNoteEvent::to_flush'; @@ -1413,6 +1414,7 @@ sub add_maildir_watch ($$) { sub refresh_watches { my ($lei) = @_; + $dir_idle or return; my $cfg = _lei_cfg($lei) or return; my $old = $cfg->{-watches}; my $watches = $cfg->{-watches} //= {}; -- cgit v1.2.3-24-ge0c7