errToPickResult is a helper function which converts the error value returned by Pick() to a string that represents the pick result.
(err error)
| 167 | // errToPickResult is a helper function which converts the error value returned |
| 168 | // by Pick() to a string that represents the pick result. |
| 169 | func errToPickResult(err error) string { |
| 170 | if err == nil { |
| 171 | return "complete" |
| 172 | } |
| 173 | if errors.Is(err, balancer.ErrNoSubConnAvailable) { |
| 174 | return "queue" |
| 175 | } |
| 176 | if _, ok := status.FromError(err); ok { |
| 177 | return "drop" |
| 178 | } |
| 179 | return "fail" |
| 180 | } |
| 181 | |
| 182 | // delegateToChildPoliciesLocked is a helper function which iterates through the |
| 183 | // list of child policy wrappers in a cache entry and attempts to find a child |