grpc / grpc-go

The Go language implementation of gRPC. HTTP/2 based RPC

Home Page:https://grpc.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In picker logic(picker_wrapper.go), clearly understand the real reason for failures after a context.Error(timeout)

holdno opened this issue · comments

if err == balancer.ErrNoSubConnAvailable {

Should we consider setting the error content for lastPickErr so that clients can clearly understand the real reason for failures after a timeout? This might improve troubleshooting and user experience.

if err == balancer.ErrNoSubConnAvailable {
    lastPickErr = err
    continue
}

Hi @holdno, can you please share your findings on running your code?

commented

If the server-side balancer picks balancer.ErrNoSubConnAvailable, the gRPC picking logic will cause the context (ctx) to block until it times out. As a result, from the client's perspective, it appears as if there is a server response timeout, without knowing that it is due to NoSubConnAvailable.

What kind of code execution results do you need me to provide? Could you give an example or refer to another issue? Alternatively, I could submit the changes as a PR.
Thank you.

#7143