Make completion queue shutdown stricter

pull/22762/head
Lidi Zheng 5 years ago
parent f65fb9fd38
commit b2c815c63e
  1. 3
      src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi

@ -15,6 +15,7 @@
import socket
cdef gpr_timespec _GPR_INF_FUTURE = gpr_inf_future(GPR_CLOCK_REALTIME)
cdef float _POLL_AWAKE_INTERVAL_S = 0.2
IF UNAME_SYSNAME == "Windows":
@ -80,6 +81,8 @@ cdef class PollerCompletionQueue(BaseCompletionQueue):
self._loop.remove_reader(self._read_socket)
# TODO(https://github.com/grpc/grpc/issues/22365) perform graceful shutdown
grpc_completion_queue_shutdown(self._cq)
while not self._shutdown:
self._poller_thread.join(timeout=_POLL_AWAKE_INTERVAL_S)
grpc_completion_queue_destroy(self._cq)
def _handle_events(self):

Loading…
Cancel
Save