From: Eric Wong Date: Sun, 26 Sep 2021 05:38:19 +0000 (-0700) Subject: lei: ensure refresh_watches isn't called from workers X-Git-Tag: v1.7.0~261 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=6b941fd4a98be259c9cf4edbb23fe1a01053fab7 lei: ensure refresh_watches isn't called from workers Only the top-level lei-daemon will do inotify/kevent. --- 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} //= {};