From cb4f09264abe20c820939814e87442fe812713bc Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 9 Jan 2020 11:14:50 +0000 Subject: 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. --- 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 -- cgit v1.2.3-24-ge0c7