diff options
| author | Daniil Cherednik <[email protected]> | 2023-05-05 11:09:01 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2023-05-05 11:09:01 +0300 |
| commit | b5a989b16cafa8a3b3bc076f1097a0eda6f48c06 (patch) | |
| tree | 4da744117a5aab37758921fa43b95a3068e5aec1 /library/cpp/actors/interconnect/poller_actor_linux.h | |
| parent | fc1cffcfa7f0497a1f97b384a24bcbf23362f3be (diff) | |
Ydb stable 23-1-2623.1.26
x-stable-origin-commit: 22184a7e157553d447f17a2dffc4ea2d32dfd74d
Diffstat (limited to 'library/cpp/actors/interconnect/poller_actor_linux.h')
| -rw-r--r-- | library/cpp/actors/interconnect/poller_actor_linux.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/library/cpp/actors/interconnect/poller_actor_linux.h b/library/cpp/actors/interconnect/poller_actor_linux.h index dd4f7c0124d..6bd2cc258fd 100644 --- a/library/cpp/actors/interconnect/poller_actor_linux.h +++ b/library/cpp/actors/interconnect/poller_actor_linux.h @@ -30,7 +30,7 @@ namespace NActors { close(EpollDescriptor); } - void ProcessEventsInLoop() { + bool ProcessEventsInLoop() { // preallocated array for events std::array<epoll_event, 256> events; @@ -42,12 +42,14 @@ namespace NActors { // check return status for any errors if (numReady == -1) { if (errno == EINTR) { - return; // restart the call a bit later + return false; // restart the call a bit later } else { Y_FAIL("epoll_wait() failed with %s", strerror(errno)); } } + bool res = false; + for (int i = 0; i < numReady; ++i) { const epoll_event& ev = events[i]; if (auto *record = static_cast<TSocketRecord*>(ev.data.ptr)) { @@ -73,8 +75,12 @@ namespace NActors { // issue notifications Notify(record, read, write); + } else { + res = true; } } + + return res; } void UnregisterSocketInLoop(const TIntrusivePtr<TSharedDescriptor>& socket) { @@ -110,5 +116,5 @@ namespace NActors { }; using TPollerThread = TEpollThread; - + } // namespace NActors |
