summaryrefslogtreecommitdiff
path: root/src/ae_epoll.c
Commit message (Collapse)AuthorAgeFilesLines
* Fail fast when systemic error occurs in poll (#8749)Andy Pan2021-04-261-0/+3
| | | | | | | 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.
* Fix busy loop in ae.c when timer event is about to fire (#8764)Oran Agra2021-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | The code used to decide on the next time to wake on a timer with microsecond accuracy, but when deciding to go to sleep it used milliseconds accuracy (with truncation), this means that it would wake up too early, see that there's no timer to process, and go to sleep again for 0ms again and again until the right microsecond arrived. i.e. a timer for 100ms, would sleep for 99ms, but then do a busy loop through the kernel in the last millisecond, triggering many calls to beforeSleep. The fix is to change all the logic in ae.c to work with microseconds, which is good since most of the ae backends support micro (or even nano) seconds. however the epoll backend, doesn't support micro, so to avoid this problem it needs to round upwards, rather than truncate. Issue created by the monotonic timer PR #7644 (redis 6.2) Before that, all the timers in ae.c were in milliseconds (using mstime), so when it requested the backend to sleep till the next timer event, it would have worked ok.
* Use FD_CLOEXEC in Sentinel, so that FDs don't leak to the scripts it runs ↵Andy Pan2021-01-191-0/+1
| | | | | | | | | (#8242) Sentinel uses execve to run scripts, so it needs to use FD_CLOEXEC on all file descriptors, so that they're not accessible by the script it runs. This commit includes a change to the sentinel tests, which verifies no FDs are left opened when the script is executed.
* diskless replication rdb transfer uses pipe, and writes to sockets form the ↵Oran Agra2019-10-071-2/+2
| | | | | | | | | | | | | parent process. misc: - handle SSL_has_pending by iterating though these in beforeSleep, and setting timeout of 0 to aeProcessEvents - fix issue with epoll signaling EPOLLHUP and EPOLLERR only to the write handlers. (needed to detect the rdb pipe was closed) - add key-load-delay config for testing - trim connShutdown which is no longer needed - rioFdsetWrite -> rioFdWrite - simplified since there's no longer need to write to multiple FDs - don't detect rdb child exited (don't call wait3) until we detect the pipe is closed - Cleanup bad optimization from rio.c, add another one
* various cleanups and minor fixesOran Agra2016-04-251-4/+2
|
* Fixed grammar: before H the article is a, not an.antirez2013-12-051-1/+1
|
* ae.c event loop: API to resize the fd set size on the run.antirez2013-06-281-0/+7
|
* BSD license added to every C source and header file.antirez2012-11-081-2/+29
|
* mark fd as writable when EPOLLERR or EPOLLHUP is returned by epoll_wait.jokea2012-06-291-0/+2
|
* ae_epoll.c typo introduced in the previous commit fixed.antirez2011-12-151-1/+1
|
* Max limit to 10k clients removed, this implements feature request on issue #194antirez2011-12-151-2/+9
|
* Fixed a theoretical memory leak with no practical effects in ae_kqueue.c and ↵antirez2011-12-071-1/+4
| | | | ae_epoll.c, thanks to magicyang87 for reporting it.
* redis.c split into many different C files.antirez2010-07-011-0/+91
networking related stuff moved into networking.c moved more code more work on layout of source code SDS instantaneuos memory saving. By Pieter and Salvatore at VMware ;) cleanly compiling again after the first split, now splitting it in more C files moving more things around... work in progress split replication code splitting more Sets split Hash split replication split even more splitting more splitting minor change