Passing cancel signal to Core for Unary Call as well

pull/21506/head
Lidi Zheng 5 years ago
parent 6f0ffef2e9
commit a3d7733dd0
  1. 11
      src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi
  2. 1
      src/python/grpcio/grpc/experimental/aio/_call.py

@ -77,11 +77,6 @@ cdef class _AioCall:
"""Destroys the corresponding Core object for this RPC."""
grpc_call_unref(self._grpc_call_wrapper.call)
@property
def locally_cancelled(self):
"""Grant Python layer access of the cancelled flag."""
return self._is_locally_cancelled
def cancel(self, AioRpcStatus status):
"""Cancels the RPC in Core with given RPC status.
@ -112,12 +107,6 @@ cdef class _AioCall:
# By implementation, grpc_call_cancel always return OK
error = grpc_call_cancel(self._grpc_call_wrapper.call, NULL)
assert error == GRPC_CALL_OK
status = AioRpcStatus(
StatusCode.cancelled,
_UNKNOWN_CANCELLATION_DETAILS,
None,
None,
)
async def unary_unary(self,
bytes request,

@ -297,6 +297,7 @@ class UnaryUnaryCall(Call, _base_call.UnaryUnaryCall):
"""Forwards the application cancellation reasoning."""
if not self._status.done():
self._set_status(status)
self._cython_call.cancel(status)
self._call.cancel()
return True
else:

Loading…
Cancel
Save