Skip to content

Commit 3c6e4e9

Browse files
Fix: timers stop firing if the reactor has no sockets, only happens on bots that have little activity (#1401)
1 parent 6e19fed commit 3c6e4e9

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/dpp/socketengines/epoll.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@ struct DPP_EXPORT socket_engine_epoll : public socket_engine_base {
7777

7878
void process_events() final {
7979
const int sleep_length = 1000;
80-
if (sockets == 0) {
81-
/* epoll_wait() on empty set waits forever (or until another thread inserts a socket into the set.
82-
* We can't trust that this is going to happen, and it may deadlock the cluster, so in the event the
83-
* set is empty, we wait a millisecond (so it isn't a busy-wait) and return.
84-
*/
85-
std::this_thread::sleep_for(std::chrono::milliseconds(1));
86-
return;
87-
}
8880
int i = epoll_wait(epoll_handle, events.data(), MAX_EVENTS, sleep_length);
8981

9082
for (int j = 0; j < i; j++) {

src/dpp/socketengines/kqueue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct DPP_EXPORT socket_engine_kqueue : public socket_engine_base {
6363

6464
int i = kevent(kqueue_handle, nullptr, 0, ke_list.data(), static_cast<int>(ke_list.size()), &ts);
6565
if (i < 0) {
66+
prune();
6667
return;
6768
}
6869

0 commit comments

Comments
 (0)