From a8b6596d233556980adc09589c9022e8a7901755 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Mon, 26 Apr 2021 20:52:06 +0800 Subject: Fail fast when systemic error occurs in poll (#8749) Most of the ae.c backends didn't explicitly handle errors, and instead ignored all errors and did an implicit retry. This is desired for EAGAIN and EINTER, but in case of other systematic errors, we prefer to fail and log the error we got rather than get into a busy loop. --- src/ae_evport.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/ae_evport.c') diff --git a/src/ae_evport.c b/src/ae_evport.c index 7a0b03aea..025409331 100644 --- a/src/ae_evport.c +++ b/src/ae_evport.c @@ -291,8 +291,7 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) { return 0; /* Any other error indicates a bug. */ - perror("aeApiPoll: port_get"); - abort(); + panic("aeApiPoll: port_get, %s", strerror(errno)); } state->npending = nevents; -- cgit v1.2.1