diff options
-rw-r--r-- | include/grpc++/impl/codegen/client_unary_call.h | 1 | ||||
-rw-r--r-- | include/grpc/impl/codegen/port_platform.h | 13 | ||||
-rw-r--r-- | src/core/lib/iomgr/ev_poll_posix.cc | 11 |
3 files changed, 10 insertions, 15 deletions
diff --git a/include/grpc++/impl/codegen/client_unary_call.h b/include/grpc++/impl/codegen/client_unary_call.h index 256dd859d3..543e54b972 100644 --- a/include/grpc++/impl/codegen/client_unary_call.h +++ b/include/grpc++/impl/codegen/client_unary_call.h @@ -65,6 +65,7 @@ class BlockingUnaryCallImpl { context->initial_metadata_flags()); ops.RecvInitialMetadata(context); ops.RecvMessage(result); + ops.AllowNoMessage(); ops.ClientSendClose(); ops.ClientRecvStatus(context, &status_); call.PerformOps(&ops); diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 5a0ed85111..f4bc3eb3e0 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -305,20 +305,23 @@ * This is primarily because of linker problems and toolchain misconfiguration: * TLS isn't supported until NDK r12b per * https://developer.android.com/ndk/downloads/revision_history.html + * TLS also does not work with Android NDK if GCC is being used as the compiler + * instead of Clang. * Since NDK r16, `__NDK_MAJOR__` and `__NDK_MINOR__` are defined in * <android/ndk-version.h>. For NDK < r16, users should define these macros, * e.g. `-D__NDK_MAJOR__=11 -D__NKD_MINOR__=0` for NDK r11. */ -#if defined(__ANDROID__) && defined(__clang__) && defined(GPR_GCC_TLS) +#if defined(__ANDROID__) && defined(GPR_GCC_TLS) #if __has_include(<android/ndk-version.h>) #include <android/ndk-version.h> #endif /* __has_include(<android/ndk-version.h>) */ -#if defined(__ANDROID__) && defined(__clang__) && defined(__NDK_MAJOR__) && \ - defined(__NDK_MINOR__) && \ - ((__NDK_MAJOR__ < 12) || ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1))) +#if (defined(__clang__) && defined(__NDK_MAJOR__) && defined(__NDK_MINOR__) && \ + ((__NDK_MAJOR__ < 12) || \ + ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1)))) || \ + (defined(__GNUC__) && !defined(__clang__)) #undef GPR_GCC_TLS #define GPR_PTHREAD_TLS 1 #endif -#endif /*defined(__ANDROID__) && defined(__clang__) && defined(GPR_GCC_TLS) */ +#endif /*defined(__ANDROID__) && defined(GPR_GCC_TLS) */ #if defined(__has_include) #if __has_include(<atomic>) diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc index 7ea1dfaa80..5fa02017f0 100644 --- a/src/core/lib/iomgr/ev_poll_posix.cc +++ b/src/core/lib/iomgr/ev_poll_posix.cc @@ -71,7 +71,6 @@ struct grpc_fd { int shutdown; int closed; int released; - gpr_atm pollhup; grpc_error* shutdown_error; /* The watcher list. @@ -336,7 +335,6 @@ static grpc_fd* fd_create(int fd, const char* name) { r->on_done_closure = nullptr; r->closed = 0; r->released = 0; - gpr_atm_no_barrier_store(&r->pollhup, 0); r->read_notifier_pollset = nullptr; char* name2; @@ -952,8 +950,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset, pfds[0].events = POLLIN; pfds[0].revents = 0; for (i = 0; i < pollset->fd_count; i++) { - if (fd_is_orphaned(pollset->fds[i]) || - gpr_atm_no_barrier_load(&pollset->fds[i]->pollhup) == 1) { + if (fd_is_orphaned(pollset->fds[i])) { GRPC_FD_UNREF(pollset->fds[i], "multipoller"); } else { pollset->fds[fd_count++] = pollset->fds[i]; @@ -1020,12 +1017,6 @@ static grpc_error* pollset_work(grpc_pollset* pollset, pfds[i].fd, (pfds[i].revents & POLLIN_CHECK) != 0, (pfds[i].revents & POLLOUT_CHECK) != 0, pfds[i].revents); } - /* This is a mitigation to prevent poll() from spinning on a - ** POLLHUP https://github.com/grpc/grpc/pull/13665 - */ - if (pfds[i].revents & POLLHUP) { - gpr_atm_no_barrier_store(&watchers[i].fd->pollhup, 1); - } fd_end_poll(&watchers[i], pfds[i].revents & POLLIN_CHECK, pfds[i].revents & POLLOUT_CHECK, pollset); } |