pull/22258/head
Lidi Zheng 5 years ago
parent 1d13ec88de
commit 0ee33a4762
  1. 2
      src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi
  2. 3
      src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi
  3. 1216
      src/python/grpcio_tests/tests_aio/unit/call_test.py

@ -170,6 +170,7 @@ cdef grpc_error* asyncio_resolve(
char* host,
char* port,
grpc_resolved_addresses** res) with gil:
_LOGGER.debug('asyncio_resolve')
result = native_socket.getaddrinfo(host, port)
res[0] = tuples_to_resolvaddr(result)
@ -178,6 +179,7 @@ cdef void asyncio_resolve_async(
grpc_custom_resolver* grpc_resolver,
char* host,
char* port) with gil:
_LOGGER.debug('asyncio_resolve_async')
resolver = _AsyncioResolver.create(grpc_resolver)
resolver.resolve(host, port)

@ -32,7 +32,9 @@ cdef class _AsyncioResolver:
async def _async_resolve(self, bytes host, bytes port):
self._task_resolve = None
try:
_LOGGER.debug('_AsyncioResolver before')
resolved = await grpc_aio_loop().getaddrinfo(host, port)
_LOGGER.debug('_AsyncioResolver after')
except Exception as e:
grpc_custom_resolve_callback(
<grpc_custom_resolver*>self._grpc_resolver,
@ -50,6 +52,7 @@ cdef class _AsyncioResolver:
cdef void resolve(self, char* host, char* port):
assert not self._task_resolve
_LOGGER.debug('_AsyncioResolver resolve')
self._task_resolve = grpc_aio_loop().create_task(
self._async_resolve(host, port)
)

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save