Merge pull request #21712 from lidizheng/fix-import

[Aio] Fix a segfault in check connectivity state
pull/21742/head
Lidi Zheng 5 years ago committed by GitHub
commit d803bc8e4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pyx.pxi

@ -53,10 +53,13 @@ cdef class AioChannel:
def check_connectivity_state(self, bint try_to_connect):
"""A Cython wrapper for Core's check connectivity state API."""
return grpc_channel_check_connectivity_state(
self.channel,
try_to_connect,
)
if self._status == AIO_CHANNEL_STATUS_DESTROYED:
return ConnectivityState.shutdown
else:
return grpc_channel_check_connectivity_state(
self.channel,
try_to_connect,
)
async def watch_connectivity_state(self,
grpc_connectivity_state last_observed_state,
@ -90,8 +93,8 @@ cdef class AioChannel:
return True
def close(self):
grpc_channel_destroy(self.channel)
self._status = AIO_CHANNEL_STATUS_DESTROYED
grpc_channel_destroy(self.channel)
def call(self,
bytes method,

Loading…
Cancel
Save