diff options
author | kpayson64 <kpayson@google.com> | 2016-10-18 15:30:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-18 15:30:39 -0700 |
commit | 06755b7c49590325f58248a14e68b48f1f4f7977 (patch) | |
tree | e6aa6d5ed635cb8c004d41cb7a89fc53a1ced7a8 /src/core/lib/iomgr/ev_poll_posix.c | |
parent | 5470cb36ecfac79087ea0ad84e22d089eff4a812 (diff) | |
parent | 7347ad8fe07b7a288572dd5543019440112f61b1 (diff) |
Merge pull request #8330 from kpayson64/poll_failure
Wakeup fds on bad poll
Diffstat (limited to 'src/core/lib/iomgr/ev_poll_posix.c')
-rw-r--r-- | src/core/lib/iomgr/ev_poll_posix.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/ev_poll_posix.c b/src/core/lib/iomgr/ev_poll_posix.c index 351b069613..27e966c18c 100644 --- a/src/core/lib/iomgr/ev_poll_posix.c +++ b/src/core/lib/iomgr/ev_poll_posix.c @@ -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++) { |