-
Notifications
You must be signed in to change notification settings - Fork 296
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
Review and Refactor Goroutine Context Handling #2465
Comments
There are some cases to check:
|
1.a.controllers/vspherecluster_reconciler.go#L458
Conclusion: this go routines could get improved (what to be improved: to be defined 2.a. pkg/manager/manager.go#L135 and pkg/manager/manager.go#L147
Conclusion: this go routines are OK |
The go routines are 3 are more complex to analyse and also kind of depend on each other sometimes. 3.a. util.go#L219
Conclusion: this go routine is OK as is |
I will need some more time to take a look at 3.b. to 3.e. , if anyone wants to go ahead, feel free. |
/assign |
3.b. util.go#L280
There is only one case where this is used, so there is only one type of function which this go routine waits for completion: For the case of the analysis we can strip this down to
Conclusion: this go routines could maybe get improved (what to be improved: to be defined) |
For the cases 3.b, 3.d and 3.e I created a picture how they get invoked (they all are somewhat related to each other): The high level description of the
3.c. util.go#L304High-level: This go routine is then responsible for emitting events to trigger reconciliation when a VM gets new IP addresses set in vCenter, which ends when all expected IP addresses got set. The lower level description is
Conclusion: no conclusion yet, very complex, but looks like we don't need all the indirections / passing down functions and could make more readable what happens. Also thinking about if we could eliminate 3.d. and directly write to the other channel 3.d. util.go#L316Writes a single message to the GVK channel to trigger a reconciliation Conclusion: The go routine should be done immediately after writing to the GVK channel 3.e. util.go#L568
Conclusion: A potentially leak of a go routine if a VM never gets all IP addresses set |
My take:
|
Thx @chrischdi for all the research. Really nice work! Discussed with Christian what we want to do. We would:
In all other cases we would keep it as is. For 3 it's mostly because there are currently no known issues and we don't want to take the risk of breaking this code. |
/kind bug
What steps did you take and what happened:
[A clear and concise description of what the bug is.]
This is from a discussion here.
To be more specific:
What did you expect to happen:
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:
kubectl version
):/etc/os-release
):The text was updated successfully, but these errors were encountered: