It's possible for ->event_step to fire twice due to ->requeue
with EPOLLET (but not EPOLLONESHOT).  So account for that and
avoid causing event loop errors as a result.
---
 lib/PublicInbox/InputPipe.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/InputPipe.pm b/lib/PublicInbox/InputPipe.pm
index 00813a0701b1..e1e26e20b9d2 100644
--- a/lib/PublicInbox/InputPipe.pm
+++ b/lib/PublicInbox/InputPipe.pm
@@ -18,7 +18,7 @@ sub consume {
 
 sub event_step {
        my ($self) = @_;
-       my $r = sysread($self->{sock}, my $rbuf, 65536);
+       my $r = sysread($self->{sock} // return, my $rbuf, 65536);
        if ($r) {
                $self->{cb}->(@{$self->{args} // []}, $rbuf);
                return $self->requeue; # may be regular file or pipe
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to