go-grpc-middleware
go-grpc-middleware copied to clipboard
`grpc_retry.StreamClientInterceptor` does not pass the correct `"x-retry-attempty"` metadata value
In retry.go in the implementation of StreamClientInterceptor there is the following code:
for attempt := uint(0); attempt < callOpts.max; attempt++ {
if err := waitRetryBackoff(attempt, parentCtx, callOpts); err != nil {
return nil, err
}
callCtx := perCallContext(parentCtx, callOpts, 0)
This code should be (unless I'm missing some reason for it not to):
for attempt := uint(0); attempt < callOpts.max; attempt++ {
if err := waitRetryBackoff(attempt, parentCtx, callOpts); err != nil {
return nil, err
}
callCtx := perCallContext(parentCtx, callOpts, attempt)
Also, there seems to be an extraneous y character in the definition of AttemptMetadataKey:
const (
AttemptMetadataKey = "x-retry-attempty"
)
Hi, thanks for the issue. It appears at least the AttemptMetadataKey typo is also present in v2, though the major issue here does appear to be addressed: https://github.com/grpc-ecosystem/go-grpc-middleware/blob/a5b9e0b0458cc2e39faab057564de9efe962f0ba/interceptors/retry/retry.go#L30-L70.
Typo fixed in https://github.com/grpc-ecosystem/go-grpc-middleware/pull/543