retry_interceptor.go: Log the method that failed

When getting warnings from the retry_interceptors that RPCs failed, they
provide very little context as to what exactly failed.

I used this patch to try debugging
https://groups.google.com/g/etcd-dev/c/3hxxr9ktdpM.
dependabot/go_modules/go.uber.org/atomic-1.10.0
Jille Timmermans 2022-01-16 16:46:50 +01:00
parent f4266e2d75
commit 3710083dc3
1 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,7 @@ func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClien
c.GetLogger().Debug(
"retrying of unary invoker",
zap.String("target", cc.Target()),
zap.String("method", method),
zap.Uint("attempt", attempt),
)
lastErr = invoker(ctx, method, req, reply, cc, grpcOpts...)
@ -63,6 +64,7 @@ func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClien
c.GetLogger().Warn(
"retrying of unary invoker failed",
zap.String("target", cc.Target()),
zap.String("method", method),
zap.Uint("attempt", attempt),
zap.Error(lastErr),
)