aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2018-03-07 14:06:20 -0800
committerGravatar GitHub <noreply@github.com>2018-03-07 14:06:20 -0800
commitb243732f3fe7392a1ae4ed36f18962415c56050d (patch)
treeb39c24fdd1da251633726ee601ad6d0ffb9291a6 /src
parent8b875ac9413978370c4eafa2e2fb6a3b2f054297 (diff)
parenta37e8deeaea6b0685cc47213aacd121ae24d43d0 (diff)
Merge pull request #14448 from kpayson64/remove_poller
Remove Python background poller thread
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.cc4
-rw-r--r--src/python/grpcio/grpc/_channel.py5
-rw-r--r--src/python/grpcio_tests/tests/unit/_reconnect_test.py5
3 files changed, 6 insertions, 8 deletions
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc
index 6120f9f44b..436537bc0b 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -876,7 +876,6 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
grpc_pollset_worker** worker_hdl,
grpc_millis deadline) {
GPR_TIMER_SCOPE("pollset_work", 0);
-
grpc_pollset_worker worker;
if (worker_hdl) *worker_hdl = &worker;
grpc_error* error = GRPC_ERROR_NONE;
@@ -927,7 +926,8 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
gpr_tls_set(&g_current_thread_poller, (intptr_t)pollset);
while (keep_polling) {
keep_polling = 0;
- if (!pollset->kicked_without_pollers) {
+ if (!pollset->kicked_without_pollers ||
+ deadline <= grpc_core::ExecCtx::Get()->Now()) {
if (!added_worker) {
push_front_worker(pollset, &worker);
added_worker = 1;
diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py
index 25a4210974..2eff08aa57 100644
--- a/src/python/grpcio/grpc/_channel.py
+++ b/src/python/grpcio/grpc/_channel.py
@@ -906,11 +906,6 @@ class Channel(grpc.Channel):
self._call_state = _ChannelCallState(self._channel)
self._connectivity_state = _ChannelConnectivityState(self._channel)
- # TODO(https://github.com/grpc/grpc/issues/9884)
- # Temporary work around UNAVAILABLE issues
- # Remove this once c-core has retry support
- _subscribe(self._connectivity_state, lambda *args: None, None)
-
def subscribe(self, callback, try_to_connect=None):
_subscribe(self._connectivity_state, callback, try_to_connect)
diff --git a/src/python/grpcio_tests/tests/unit/_reconnect_test.py b/src/python/grpcio_tests/tests/unit/_reconnect_test.py
index 8acba5a30b..a708d8d862 100644
--- a/src/python/grpcio_tests/tests/unit/_reconnect_test.py
+++ b/src/python/grpcio_tests/tests/unit/_reconnect_test.py
@@ -89,7 +89,10 @@ class ReconnectTest(unittest.TestCase):
multi_callable = channel.unary_unary(_UNARY_UNARY)
self.assertEqual(_RESPONSE, multi_callable(_REQUEST))
server.stop(None)
- time.sleep(1)
+ # By default, the channel connectivity is checked every 5s
+ # GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS can be set to change
+ # this.
+ time.sleep(5.1)
server = grpc.server(server_pool, (handler,))
server.add_insecure_port('[::]:{}'.format(port))
server.start()