[Aio] use timeout instead of deadline for intercepted call creation (#33951)

Intercepted call class expect a timeout as parameters but a deadline is
provided instead. Only the UnaryUnary class is correctly created with a
timeout while the others remains with the deadlines. This commit fix the
instanciation of the other ones.




<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
pull/31013/head^2
Sparkling Diva 1 year ago committed by GitHub
parent e076acd96b
commit df9ec2b0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      src/python/grpcio/grpc/aio/_channel.py

@ -188,12 +188,11 @@ class UnaryStreamMultiCallable(
compression: Optional[grpc.Compression] = None,
) -> _base_call.UnaryStreamCall[RequestType, ResponseType]:
metadata = self._init_metadata(metadata, compression)
deadline = _timeout_to_deadline(timeout)
if not self._interceptors:
call = UnaryStreamCall(
request,
deadline,
_timeout_to_deadline(timeout),
metadata,
credentials,
wait_for_ready,
@ -207,7 +206,7 @@ class UnaryStreamMultiCallable(
call = InterceptedUnaryStreamCall(
self._interceptors,
request,
deadline,
timeout,
metadata,
credentials,
wait_for_ready,
@ -234,12 +233,11 @@ class StreamUnaryMultiCallable(
compression: Optional[grpc.Compression] = None,
) -> _base_call.StreamUnaryCall:
metadata = self._init_metadata(metadata, compression)
deadline = _timeout_to_deadline(timeout)
if not self._interceptors:
call = StreamUnaryCall(
request_iterator,
deadline,
_timeout_to_deadline(timeout),
metadata,
credentials,
wait_for_ready,
@ -253,7 +251,7 @@ class StreamUnaryMultiCallable(
call = InterceptedStreamUnaryCall(
self._interceptors,
request_iterator,
deadline,
timeout,
metadata,
credentials,
wait_for_ready,
@ -280,12 +278,11 @@ class StreamStreamMultiCallable(
compression: Optional[grpc.Compression] = None,
) -> _base_call.StreamStreamCall:
metadata = self._init_metadata(metadata, compression)
deadline = _timeout_to_deadline(timeout)
if not self._interceptors:
call = StreamStreamCall(
request_iterator,
deadline,
_timeout_to_deadline(timeout),
metadata,
credentials,
wait_for_ready,
@ -299,7 +296,7 @@ class StreamStreamMultiCallable(
call = InterceptedStreamStreamCall(
self._interceptors,
request_iterator,
deadline,
timeout,
metadata,
credentials,
wait_for_ready,

Loading…
Cancel
Save