grpc: ClientAsyncWriter::Write does not return false on CompletionQueue when stream is closed

Hello,

What version of gRPC and what language are you using?

C++ with gRPC 1.10.0

What operating system (Linux, Windows, …) and version?

Windows

What runtime / compiler are you using (e.g. python version or version of gcc)

MSVC 19.13.26129

What did you do?

I am creating a client to server streaming RPC with the following RPC definition:

rpc ClientStream(stream Request) returns (Response);

The client streams multiple requests to the server, which then decides on it’s own when to close the stream and sends a response back to the client.

What did you expect to see?

I expected the client’s completion queue to return false on the Write operation after the server closed the stream. This assumption is based on the documentation of the synchronous counterpart bool ClientWriter::Write(). It says: \return \a true on success, \a false when the stream has been closed.

What did you see instead?

The completion queue returns true on the write operation and the client just continues to stream requests, although the server closed the stream.

Anything else we should know about your project / environment?

I compared the behaviour with a python client implementation. Here, the python client gets notified that the stream was closed and displays the correct response.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 34 (19 by maintainers)

Most upvoted comments

Any updates here?

Thanks also for filling in a lot of details that have made it possible for us to reproduce this issue and better understand it. I’m going to seek some help on this before getting back to you. For performance reasons, we have expanded flow control buffers (and let them dynamically expand as well) in recent releases, so I want to understand the interaction with that properly before answering the issue about notification.