Skip to content

Commit b0b5b52

Browse files
pasisigor-ivanov
authored andcommitted
issue: 1792164 Remove epoll event when it is consumed
Zcopy notification mechanism (error queue) adds an event EPOLLERR to respective epfd_info object and it is never removed. This leads to the issue that epoll_wait() returns EPOLLERR event endlessly and doesn't enter polling loops. Fix this by removing EPOLLERR event when socket becomes not "errorable". The fix avoids fake EPOLLERR events and allows epoll_wait_helper() to perform polling.
1 parent 1392cb6 commit b0b5b52

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/vma/iomux/epoll_wait_call.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ int epoll_wait_call::get_current_events()
117117
mutual_events &= ~EPOLLOUT;
118118
}
119119

120+
// handle zcopy notification mechanism
121+
if (mutual_events & EPOLLERR) {
122+
int unused;
123+
if (handle_epoll_event(p_socket_object->is_errorable(&unused), EPOLLERR, p_socket_object, i)) {
124+
got_event = true;
125+
}
126+
mutual_events &= ~EPOLLERR;
127+
}
128+
120129
if (mutual_events) {
121130
if (handle_epoll_event(true, mutual_events, p_socket_object, i)) {
122131
got_event = true;

0 commit comments

Comments
 (0)