From 668a842c1b7beed375989a5988583533017abae1 Mon Sep 17 00:00:00 2001 From: kpayson64 Date: Mon, 10 Oct 2016 01:40:09 -0700 Subject: Wakeup fds on bad poll --- src/core/lib/iomgr/ev_poll_posix.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/core/lib/iomgr/ev_poll_posix.c') diff --git a/src/core/lib/iomgr/ev_poll_posix.c b/src/core/lib/iomgr/ev_poll_posix.c index 16a5e3083e..3de329c645 100644 --- a/src/core/lib/iomgr/ev_poll_posix.c +++ b/src/core/lib/iomgr/ev_poll_posix.c @@ -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++) { -- cgit v1.2.3 From 7347ad8fe07b7a288572dd5543019440112f61b1 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Tue, 11 Oct 2016 11:12:29 -0700 Subject: Use booleans instead of bitmask args --- src/core/lib/iomgr/ev_poll_posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core/lib/iomgr/ev_poll_posix.c') diff --git a/src/core/lib/iomgr/ev_poll_posix.c b/src/core/lib/iomgr/ev_poll_posix.c index 3de329c645..1fead8a895 100644 --- a/src/core/lib/iomgr/ev_poll_posix.c +++ b/src/core/lib/iomgr/ev_poll_posix.c @@ -968,8 +968,7 @@ static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, } 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); + fd_end_poll(exec_ctx, &watchers[i], 1, 1, pollset); } } } else if (r == 0) { -- cgit v1.2.3