grpclib
grpclib copied to clipboard
GRPC Options (Retry specifically) support
The official grpc client supports grpc service config and allows for client side retry (example. Is this something that could be done with an event? Or would retry have to be built into each client call.
Currently such configuration is not implemented.
I probably saw somewhere that some people were trying to subclass the Channel
class to override __connect__
method. This way you can implement your retry logic, but __connect__
method is not documented and not meant to be overridden, so there is no guarantee that this method wont change in the future versions. But this won't likely happen.
The only limitation here is that you can only catch connection errors, you wont be able to retry here on some specific status codes.
It is also possible to extend RecvTrailingMetadata
event with a status code (have to be implemented in grpclib), which will give an ability to implement connection close on specific status codes.
Missed this response somehow.
So is the suggestion to try and override __connect__
to handle connection errors, and then use RecvTrailingMetadata
to cause a connection error on a specific status code?
So is the suggestion to try and override
__connect__
to handle connection errors
yes
use
RecvTrailingMetadata
to cause a connection error on a specific status code
this is optional, I actually don't remember why I mentioned this