Open nezhibitskiy opened 1 week ago
@nezhibitskiy Could you answer the below questions:
@aranjans Hi!
Yes, I pass application version in context and parse this info from info.Ctx
in Pick(info balancer.PickInfo) (balancer.PickResult, error)
func. Using this information, my picker choses one of subchannels, which is marked as requested version.
Including the application version in error helps in determination of problem with trying to call unexist application version (originally version of application is set by user of my application, who makes request. It's kind of end-to-end version selection in microservices architecture).
But now I need to pass ErrNoSubConnAvailable
, because passing another error cases error rate at start during creating new connection to application (when channel is not in ready state).
That why I'd like to add error wrapping in my picker, because it will help me to understand, is it problem in my connections (no subchannels was created), or it's just bad request from my clients.
Hi!
In picker wrapper logic in case, when no one subconnection is unavailable, wrapper waits, until channel changes state. https://github.com/grpc/grpc-go/blob/4bb0170ac65f2726d593eb7364a807b171fa1d63/picker_wrapper.go#L158
I have my own wrapping of picker, which adds additional logic of choosing subchannel, based on request context (different versions of one application). I'd like to wrap returned error ErrNoSubConnAvailable with additional information (used version of appilcation). But strong equality of errors in picker wrapper makes it impossible. Is it possible to change this error check to smth like this: