From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6F83C1F5B1 for ; Sun, 14 Jun 2020 00:25:06 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/3] inboxidle: support Linux::Inotify2 1.x Date: Sun, 14 Jun 2020 00:25:04 +0000 Message-Id: <20200614002505.15384-3-e@yhbt.net> In-Reply-To: <20200614002505.15384-1-e@yhbt.net> References: <20200614002505.15384-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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. --- lib/PublicInbox/InboxIdle.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;