about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-14 00:25:04 +0000
committerEric Wong <e@yhbt.net>2020-06-15 06:07:54 +0000
commit192dd6249c1960380241d73d099d5477028c259a (patch)
tree67ad20d45aa319cf6697d1ebff27d10c6d74356a
parent4042599799a3706d1b1c0589675b07cab610505a (diff)
downloadpublic-inbox-192dd6249c1960380241d73d099d5477028c259a.tar.gz
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.
-rw-r--r--lib/PublicInbox/InboxIdle.pm5
1 files changed, 4 insertions, 1 deletions
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;