Closed rambattu closed 3 years ago
// If the client redundancy mode is ALL_PRIMARY, but a client // sends election_id, the network element closes the connection // to the client and responds with FAILED_PRECONDITION in // status.proto's
code
and sets ModifyRPCErrorDetails.reason // to ELECTION_ID_IN_ALL_PRIMARYWhen a client makes an invalid request via
ModifyRequest
message, is the server endpoint supposed to terminate the client connection after sending an error status?In almost all the gRPC server examples I have looked, the server has only RPC specific context, don't see a mechanism to initiate disconnection of the client. Is there any gRPC example where the server initiates the client termination as well after sending error on the RPC, that would be helpful for reference.
This is referring to the server's RPC handler returning with an error which will close the stream for that Modify. See the reference server implementation in gribigo.
checkParams
creates the errdetails and it is returned in Modify()
Maybe we can reword the text you've quoted to say closes the Modify RPC stream
instead ?
Yes @nandanarista , that will greatly help because the term "connection" can be very confusing.
https://github.com/openconfig/gribi/blob/40372e8b4395934f2ebfd30c39615e42dc383f2c/v1/proto/service/gribi.proto#L108
// If the client redundancy mode is ALL_PRIMARY, but a client // sends election_id, the network element closes the connection // to the client and responds with FAILED_PRECONDITION in // status.proto's
code
and sets ModifyRPCErrorDetails.reason // to ELECTION_ID_IN_ALL_PRIMARYWhen a client makes an invalid request via
ModifyRequest
message, is the server endpoint supposed to terminate the client connection after sending an error status?In almost all the gRPC server examples I have looked, the server has only RPC specific context, don't see a mechanism to initiate disconnection of the client. Is there any gRPC example where the server initiates the client termination as well after sending error on the RPC, that would be helpful for reference.