-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose option to eagerly create connection #2677
Comments
Use |
You also will want to use Similar to Java, Go also have a connectivity state API: https://godoc.org/google.golang.org/grpc#ClientConn.GetState |
@dfawley I looked at those, but neither say that they have any effects. GetState doesn't say that the state will ever go towards READY. WaitForStateChange doesn't imply it kick the ClientConn towards READY, only that if it does change, it will eventually run. Neither move the ClientConn towards the state I want. @lyuxuan Thanks! it would be very helpful if |
@carl-mastrangelo Go doesn't currently have the concept of idleness - it starts in |
@dfawley Then how does pick first work? Doesn't that LB policy imply that connections are lazily created? |
The balancer doesn't matter - all |
Ok so what you are saying is Dial and DialContext are always eager.
Which connection is this? In the load balanced case there may be multiple. Does it wait until failure, or success, or either? It would be great if this could be prioritized. It was confusing to me that Dial would return an error type, but not block. I think NewClient could return an $CLIENT, without an error param, making it clear that no connection has been established. |
@carl-mastrangelo If you don't want to block, you can use the connectivity state API instead.
I agree, but we have a few things in front of it right now. It will probably be a couple more quarters before it happens at this rate, assuming no new things come in. |
We always eagerly create the connection. When we support NewClient, we will update the connectivity state API to allow for this (#1786). |
There doesn't seem to be a way to eagerly connect to a target address. My use case:
gRPC Java exposes this through the channel state API, but for Go I expect this to be a DialOption.
The text was updated successfully, but these errors were encountered: