Merge pull request #14448 from kpayson64/remove_poller

Remove Python background poller thread
pull/14632/head
kpayson64 7 years ago committed by GitHub
commit b243732f3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/core/lib/iomgr/ev_poll_posix.cc
  2. 5
      src/python/grpcio/grpc/_channel.py
  3. 5
      src/python/grpcio_tests/tests/unit/_reconnect_test.py

@ -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;

@ -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)

@ -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()

Loading…
Cancel
Save