Merge pull request #13899 from mehrdada/upgrade-yapf-to-020
Upgrade yapf to 0.20.0
diff --git a/include/grpc++/impl/codegen/client_unary_call.h b/include/grpc++/impl/codegen/client_unary_call.h
index 256dd85..543e54b 100644
--- a/include/grpc++/impl/codegen/client_unary_call.h
+++ b/include/grpc++/impl/codegen/client_unary_call.h
@@ -65,6 +65,7 @@
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 5a0ed85..f4bc3eb 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 7ea1dfa..5fa0201 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -71,7 +71,6 @@
int shutdown;
int closed;
int released;
- gpr_atm pollhup;
grpc_error* shutdown_error;
/* The watcher list.
@@ -336,7 +335,6 @@
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 @@
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 @@
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);
}