* [PATCH] lei: ensure refresh_watches isn't called from workers
@ 2021-09-26 5:38 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-09-26 5:38 UTC (permalink / raw)
To: meta
Only the top-level lei-daemon will do inotify/kevent.
---
lib/PublicInbox/LEI.pm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index a337fb0d80c2..8faf74a29466 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} //= {};
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-26 5:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 5:38 [PATCH] lei: ensure refresh_watches isn't called from workers Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).