]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
ds: confess on epoll_ctl failure
authorEric Wong <e@80x24.org>
Tue, 17 Jun 2025 00:13:32 +0000 (00:13 +0000)
committerEric Wong <e@80x24.org>
Wed, 18 Jun 2025 11:04:27 +0000 (11:04 +0000)
ENOENT on epoll_ctl(2) is always a sign of buggy code and it
makes sense to dump the backtrace by default, here.  I've only
noticed this failure on HTTPS connections.

lib/PublicInbox/DS.pm

index 472f845c7df92f6f3d6194ea1aeb6f9f6c2cfb1f..ad01ffc8cd0b4546019fdb78808f5d2569578ffc 100644 (file)
@@ -34,7 +34,7 @@ use PublicInbox::Tmpfile;
 use PublicInbox::Select;
 use PublicInbox::OnDestroy;
 use Errno qw(EAGAIN EINVAL ECHILD);
-use Carp qw(carp croak);
+use Carp qw(carp croak confess);
 use List::Util qw(sum);
 our @EXPORT_OK = qw(now msg_more awaitpid add_timer add_uniq_timer);
 my $sendmsg_more = PublicInbox::Syscall->can('sendmsg_more');
@@ -395,7 +395,7 @@ sub epbit ($$) { # (sock, default)
 
 sub epwait ($$) {
        my ($io, $ev) = @_;
-       $Poller and $Poller->ep_mod($io, $ev) and croak "EPOLL_CTL_MOD $io: $!";
+       $Poller and $Poller->ep_mod($io, $ev) and confess "BUG: ep_mod $io: $!";
 }
 
 # returns 1 if done, 0 if incomplete