summaryrefslogtreecommitdiff
path: root/src/ae_kqueue.c
diff options
context:
space:
mode:
authorAndy Pan <panjf2000@gmail.com>2021-04-26 20:52:06 +0800
committerGitHub <noreply@github.com>2021-04-26 15:52:06 +0300
commita8b6596d233556980adc09589c9022e8a7901755 (patch)
treea3832fbb9da8fbdb2e3fc94d4bd49027511a953f /src/ae_kqueue.c
parentd1ca1e665f5df75fee6d7e9034b06a9686b7b239 (diff)
downloadredis-a8b6596d233556980adc09589c9022e8a7901755.tar.gz
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.
Diffstat (limited to 'src/ae_kqueue.c')
-rw-r--r--src/ae_kqueue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ae_kqueue.c b/src/ae_kqueue.c
index b146f2519..8666b03cf 100644
--- a/src/ae_kqueue.c
+++ b/src/ae_kqueue.c
@@ -130,7 +130,10 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
eventLoop->fired[j].fd = e->ident;
eventLoop->fired[j].mask = mask;
}
+ } else if (retval == -1 && errno != EINTR) {
+ panic("aeApiPoll: kevent, %s", strerror(errno));
}
+
return numevents;
}