-
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
Suspect select in transport/control.go *quotaPool:get() #1857
Comments
Do you believe this will lead to problems? Can you explain? Selects are inherently non-deterministic, as races between the incoming signals will determine the result. |
True, but the (reasonable) expectation which the current code invalidates is: For any particular goroutine, or set of goroutines properly synchronized:
There are many |
I see what you're saying. We generally have protections in place before or after our selects in case one term should have priority. For instance, code at the top of We do have some cleanups planned here to greatly simplify most of our selects (boiling them down to a single context check and the condition they're waiting on). If you can identify real problems that are caused by the code, please don't hesitate to file issues, but I don't think there's anything actionable here at this time. |
Please answer these questions before submitting your issue.
What version of gRPC are you using?
master 2018-02-08 commit d50734d
What version of Go are you using (
go version
)?n/a
What operating system (Linux, Windows, …) and version?
n/a
What did you do?
If possible, provide a recipe for reproducing the error.
Code inspection
What did you expect to see?
Deterministic select
What did you see instead?
Appears to be non-deterministic select operation
Unless it's guaranteed that only one of these conditions can be true, then the return value is non-deterministic. Particularly troubling is the case if there is something available in qb.c.
Suspect that this is what is desired:
although then there's a spin issue. Perhaps re-factor qb.c as a combined "block getters" semaphore, put something on if any of wc.ct.Done()x, wc.tctx.Done(), wc.done, wc.goAwqay, or current qb.c semaphore cases are true.
The text was updated successfully, but these errors were encountered: