I want to verify some behavior in the Python code -- are timeouts only
respected while receiving requests and not after requests have been
received (but RPC is not finished)? Here's an example that uses a
client-streaming RPC:
Server pseudo-code:
def Server(self, request_iterator, context):
for request in request_iterator:
pass
for _ in range(10):
time.sleep(1)
print(context.is_active())
print('still running!')
return test_pb2.Response()
Client pseudo-code:
def yielder():
for _ in range(20):
yield test_pb2.Request()
stub = test_pb2_grpc.TestStub(channel)
response = stub.Server(yielder(), timeout=5)
print(response)
What happens is that the server will receive all the requests streams and
while performing an operation, the timeout will pass and context will be
inactive -- however, the RPC never aborts (i.e. the server will print
'still running!'). Is this intended behavior? I would expect that the
server to stop processing after the timeout has elapsed.
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/ee0ae836-1ed0-4909-a8af-73810deb0ca5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.