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-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,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 613E01FD47 for ; Thu, 9 Jan 2020 11:14:52 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] listener: EPOLL_CTL_ADD errors are non fatal Date: Thu, 9 Jan 2020 11:14:50 +0000 Message-Id: <20200109111452.14556-2-e@yhbt.net> In-Reply-To: <20200109111452.14556-1-e@yhbt.net> References: <20200109111452.14556-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: EPOLL_CTL_ADD may fail with transient ENOMEM or ENOSPC errors, so don't tear down the process when that happens. --- lib/PublicInbox/Listener.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Listener.pm b/lib/PublicInbox/Listener.pm index 928d9301..cdfd34a2 100644 --- a/lib/PublicInbox/Listener.pm +++ b/lib/PublicInbox/Listener.pm @@ -40,7 +40,8 @@ sub event_step { # on high-traffic sites. if (my $addr = accept(my $c, $sock)) { IO::Handle::blocking($c, 0); # no accept4 :< - $self->{post_accept}->($c, $addr, $sock); + eval { $self->{post_accept}->($c, $addr, $sock) }; + warn "E: $@\n" if $@; $self->requeue; } elsif ($! == EAGAIN || $! == ECONNABORTED || $! == EPERM) { # EAGAIN is common and likely