Cardinality violations should use error code “unimplemented”
jhump opened this issue · comments
The gRPC docs for error codes state that both client and server should use the unimplemented
code for cardinality violations. See table at the bottom of this doc (you can search for “cardinality violation” in the doc): https://grpc.github.io/grpc/core/md_doc_statuscodes.html.
A cardinality violation is when a stream contains an incorrect number of messages. Specifically, when a response stream for a unary or client-stream RPC contains zero messages with an OK status or more than one message; or when a request stream for a unary or server-stream RPC contains zero or more than one messages.
The client and server in this Go module both return an unknown
error in this situation instead of unimplemented
.
For the Java issue I mentioned this change to the spec was made without any real notification/discussion. So we may want to re-consider the spec in this case. grpc/grpc-java#11247 (comment)
@jhump we have to reconsider on deciding the error code for cardinality violations. For now, as long as an error code is being returned, we won't be making any changes.
I think we should leave this open until we decide what the behavior should be.
Should we mark it blocked
on the change to the spec, as promised in: grpc/grpc-java#11247 (comment)
I believe we've fully committed to making it INTERNAL. I don't think we need to wait on a doc update to implement it.
@ejona86 WDYT?