From: Eric Wong Date: Sun, 14 Jun 2020 00:25:04 +0000 (+0000) Subject: inboxidle: support Linux::Inotify2 1.x X-Git-Tag: v1.6.0~380 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=192dd6249c1960380241d73d099d5477028c259a;p=public-inbox.git inboxidle: support Linux::Inotify2 1.x Linux::Inotify2 1.x lacked ->on_overflow and ->broadcast methods. Just don't use them for now. We may eventually provide a pure Perl alternative which doesn't require closures, XS, or the common::sense dependency. Overflowing the inotify queue seems difficult to trigger at the moment: /proc/sys/fs/inotify/max_queued_events defaults to 16384 on a my CentOS 7.x VM with 2GB RAM. --- diff --git a/lib/PublicInbox/InboxIdle.pm b/lib/PublicInbox/InboxIdle.pm index c19b8d18..d60d4f23 100644 --- a/lib/PublicInbox/InboxIdle.pm +++ b/lib/PublicInbox/InboxIdle.pm @@ -58,7 +58,10 @@ sub new { my $sock = gensym; tie *$sock, 'PublicInbox::In2Tie', $inot; $inot->blocking(0); - $inot->on_overflow(undef); # broadcasts everything on overflow + if ($inot->can('on_overflow')) { + # broadcasts everything on overflow + $inot->on_overflow(undef); + } $self->SUPER::new($sock, EPOLLIN | EPOLLET); } else { require PublicInbox::FakeInotify;