From: Eric Wong Date: Thu, 9 Jan 2020 11:14:50 +0000 (+0000) Subject: listener: EPOLL_CTL_ADD errors are non fatal X-Git-Tag: v1.3.0~126 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=cb4f09264abe20c820939814e87442fe812713bc listener: EPOLL_CTL_ADD errors are non fatal EPOLL_CTL_ADD may fail with transient ENOMEM or ENOSPC errors, so don't tear down the process when that happens. --- 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