Skip to content

Commit

Permalink
Wakeup fds on bad poll
Browse files Browse the repository at this point in the history
  • Loading branch information
kpayson64 committed Oct 10, 2016
1 parent 062ba7b commit 668a842
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/lib/iomgr/ev_poll_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,8 +961,16 @@ static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
if (errno != EINTR) {
work_combine_error(&error, GRPC_OS_ERROR(errno, "poll"));
}

for (i = 2; i < pfd_count; i++) {
fd_end_poll(exec_ctx, &watchers[i], 0, 0, NULL);
if (watchers[i].fd == NULL) {
fd_end_poll(exec_ctx, &watchers[i], 0, 0, NULL);
} else {
// Wake up all the file descriptors, if we have an invalid one
// we can identify it on the next pollset_work()
fd_end_poll(exec_ctx, &watchers[i], POLLIN_CHECK, POLLOUT_CHECK,
pollset);
}
}
} else if (r == 0) {
for (i = 2; i < pfd_count; i++) {
Expand Down

0 comments on commit 668a842

Please sign in to comment.