We have an async bi-directional streaming setup. We have implemented a
health check on the stream and have logic where the server decides a client
is stale or gone and closes the connection with that client.
We have a Go server that is setting the error like so (I hope this is
enough to give you an idea, I don't know the Go side at all...):
done <- errors.New(fmt.Sprintf("Server did not receive pong within
grace period; subscription terminated"))
With a Python client, we get an exception on the stream correctly:
_Rendezvous: <_Rendezvous of RPC that terminated with
(StatusCode.UNKNOWN, Server did not receive pong within grace period;
subscription terminated)>
However, in C++ I cannot seem to get the above error output, which would
help the client decide how to proceed.
What I have is a completion queue on which I call AsyncNext(). I can
successfully get the 'ok' parameter to return false once the above
termination happens. Reading through the docs and other posts here on
groups it looks as though I then need to call Finish on my ReaderWriter
object and that has an out param for a status. When I call that, it seems
the status is never set and I also never see the tag I set for the Finish
operation come through my completion queue. I have tried cancelling the
stream from the client when this happens and that sets the status, but only
to say that it was cancelled.
A couple reasons I need the status code and status message: I want to be
able to respond to different issues in different and appropriate ways. I
read that AsyncNext setting 'ok' to false does not always mean there is an
issue.
Can someone help me connect these dots into the proper way to get the error
messages from the server in this situation?
Thanks!
Eric Edelman
--
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/c2f907e0-ff25-47f8-9428-f4946362843c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.