Skip to content

Commit

Permalink
Merge pull request grpc#8330 from kpayson64/poll_failure
Browse files Browse the repository at this point in the history
Wakeup fds on bad poll
  • Loading branch information
kpayson64 authored Oct 18, 2016
2 parents 5470cb3 + 7347ad8 commit 06755b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/lib/iomgr/ev_poll_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,8 +985,15 @@ 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], 1, 1, pollset);
}
}
} else if (r == 0) {
for (i = 2; i < pfd_count; i++) {
Expand Down

0 comments on commit 06755b7

Please sign in to comment.