grpc status code errors on python server side

38 views
Skip to first unread message

rvsh...@gmail.com

unread,
Mar 21, 2018, 8:57:23 AM3/21/18
to grpc.io
Hope this is the right place for questions about grpc usage. Please let me know if stackoverflow with #grpc tag is where to go in future.

I was reading https://github.com/grpc/grpc/blob/master/doc/statuscodes.md which mentions that CANCELLED and DEADLINE_EXCEEDED status code can be raised on both client and server.

However, I am not aware of a way to determine on server what has gone wrong.
1) If I try to reply (e.g. send_initial_metadata) to a call that has been cancelled, it seems on server I get an RpcError with no details about what happened
2) If I try to reply (e.g. send_initial_metadata) to a call that has exceeded deadline, it seems on server I get an RpcError with no details about what happened

https://grpc.io/grpc/python/grpc.html doesn't even mention that `send_initial_metadata` can raise an RpcError.

I'm not sure if I've misinterpreted the document when it says the status codes can be generated on both client and server, which I interpreted it to mean on the server I would be able to determine when call was in this state.

Is there some method on the server I am missing?
Message has been deleted

Nathaniel Manista

unread,
Mar 25, 2018, 12:45:16 AM3/25/18
to rvsh...@gmail.com, grpc.io
I think perhaps some of our documentation has given you the wrong idea about the philosophy of status codes. Status codes are intended to be interpreted by invocation-side applications and occasionally generated by service-side applications (at other times the service-side gRPC runtime or the client-side gRPC runtime will generate the code and send it in the direction of the invocation-side application). It is not the case that status codes are ever sent from the invocation side of an RPC to the service side of an RPC. It is not (to my knowledge) supported in gRPC that the service-side application will ever learn why an RPC was aborted ("a way to determine on server what has gone wrong"), only that the RPC was aborted and that the application should stop the work of servicing it.
-Nathaniel
Reply all
Reply to author
Forward
0 new messages