about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-09 11:14:50 +0000
committerEric Wong <e@80x24.org>2020-01-09 11:23:31 +0000
commitcb4f09264abe20c820939814e87442fe812713bc (patch)
tree3246d7b3fc47da2c5b7bdf7fb08888fa5e79212e
parentbfdf6728f442385f596175b261877ead1b37f9f6 (diff)
downloadpublic-inbox-cb4f09264abe20c820939814e87442fe812713bc.tar.gz
EPOLL_CTL_ADD may fail with transient ENOMEM or ENOSPC errors,
so don't tear down the process when that happens.
-rw-r--r--lib/PublicInbox/Listener.pm3
1 files changed, 2 insertions, 1 deletions
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