-
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
Why is DialContext not blocking by default? #1953
Comments
Ah, its from #858 I think this behaviour should be changed or clearly documented on |
Or maybe we should just deprecate |
This has different connotations. A In #1786, I have proposed deprecating It would probably be appropriate to mention the non-blocking default behavior in the docstring. |
That all sounds great to me. |
I'll keep this open to track the clarification of the docs. |
Please answer these questions before submitting your issue.
What version of gRPC are you using?
1.9.2
What version of Go are you using (
go version
)?go version go1.10 darwin/amd64
What operating system (Linux, Windows, …) and version?
macOS 10.13.3
What did you do?
If possible, provide a recipe for reproducing the error.
What did you expect to see?
An error
What did you see instead?
nil
This is because DialContext does not block by default. It should as otherwise, it doesn't really make sense to pass in a Context. If someone is passing in a Context to a Dial, its pretty much guaranteed that they want it to block as they want the Context to apply to the dial. Its extremely counter intuitive to run the dial in the background and immediately return.
The text was updated successfully, but these errors were encountered: