about summary refs log tree commit homepage
path: root/lib/PublicInbox/LEI.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-16 09:29:53 +0000
committerEric Wong <e@80x24.org>2021-10-16 10:37:08 +0000
commit584f9a6e1e47fca4041ad5205f631197c2bafc59 (patch)
tree0efacac0d8c3bf1454b452e04bc2591b2a162a67 /lib/PublicInbox/LEI.pm
parent932fea644c612d55d9a5299794c381bb7155f18b (diff)
downloadpublic-inbox-584f9a6e1e47fca4041ad5205f631197c2bafc59.tar.gz
Sigfd->event_step needs priority over script/lei clients,
LeiSelfSocket, and everything else.
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r--lib/PublicInbox/LEI.pm20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 876598f9..6b989b33 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -12,13 +12,13 @@ use parent qw(PublicInbox::DS PublicInbox::LeiExternal
         PublicInbox::LeiQuery);
 use Getopt::Long ();
 use Socket qw(AF_UNIX SOCK_SEQPACKET MSG_EOR pack_sockaddr_un);
-use Errno qw(EPIPE EAGAIN EINTR ECONNREFUSED ENOENT ECONNRESET);
+use Errno qw(EPIPE EAGAIN ECONNREFUSED ENOENT ECONNRESET);
 use Cwd qw(getcwd);
 use POSIX qw(strftime);
 use IO::Handle ();
 use Fcntl qw(SEEK_SET);
 use PublicInbox::Config;
-use PublicInbox::Syscall qw(EPOLLIN EPOLLET);
+use PublicInbox::Syscall qw(EPOLLIN);
 use PublicInbox::DS qw(now dwaitpid);
 use PublicInbox::Spawn qw(spawn popen_rd);
 use PublicInbox::Lock;
@@ -1125,16 +1125,12 @@ sub event_step {
         local %ENV = %{$self->{env}};
         local $current_lei = $self;
         eval {
-                my $buf;
-                while (my @fds = $recv_cmd->($self->{sock}, $buf, 4096)) {
-                        if (scalar(@fds) == 1 && !defined($fds[0])) {
-                                return if $! == EAGAIN;
-                                next if $! == EINTR;
-                                last if $! == ECONNRESET;
-                                die "recvmsg: $!";
-                        }
-                        for (@fds) { open my $rfh, '+<&=', $_ }
+                my @fds = $recv_cmd->($self->{sock}, my $buf, 4096);
+                if (scalar(@fds) == 1 && !defined($fds[0])) {
+                        return if $! == EAGAIN;
+                        die "recvmsg: $!" if $! != ECONNRESET;
                 }
+                for (@fds) { open my $rfh, '+<&=', $_ }
                 if ($buf eq '') {
                         _drop_wq($self); # EOF, client disconnected
                         dclose($self);
@@ -1162,7 +1158,7 @@ sub event_step_init {
         my $sock = $self->{sock} or return;
         $self->{-event_init_done} //= do { # persist til $ops done
                 $sock->blocking(0);
-                $self->SUPER::new($sock, EPOLLIN|EPOLLET);
+                $self->SUPER::new($sock, EPOLLIN);
                 $sock;
         };
 }