From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH 2/3] inboxidle: support Linux::Inotify2 1.x
Date: Sun, 14 Jun 2020 00:25:04 +0000 [thread overview]
Message-ID: <20200614002505.15384-3-e@yhbt.net> (raw)
In-Reply-To: <20200614002505.15384-1-e@yhbt.net>
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;
next prev parent reply other threads:[~2020-06-14 0:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 0:25 [PATCH 0/3] IMAP fixes for older systems Eric Wong
2020-06-14 0:25 ` [PATCH 1/3] testcommon: allow OR-ing module dependencies Eric Wong
2020-06-14 0:25 ` Eric Wong [this message]
2020-06-14 0:25 ` [PATCH 3/3] t/imapd*.t: support older Mail::IMAPClient Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200614002505.15384-3-e@yhbt.net \
--to=e@yhbt.net \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).