-
Notifications
You must be signed in to change notification settings - Fork 210
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
Use of context.TODO() #234
Comments
I think the patch you are referring to was simply the quickest workaround, and we didn't talk about what will it contain yet. I don't have any strong opinion on that. If you want to switch it, please be sure to include the why in the eventual PR. :) |
This issue was automatically considered stale due to lack of activity. Please update it and/or join our slack channels to promote it, before it automatically closes (in 7 days). |
I would like to keep that one open. |
This issue was automatically considered stale due to lack of activity. Please update it and/or join our slack channels to promote it, before it automatically closes (in 7 days). |
Is there more that needs to be done here? |
The current main still has There's two ways to solve this: Propagate a context object through all functions that call the k8s API, or use a local In one place, a |
I think that the proper path forward here is @onitake's suggestion to audit the code and, where appropriate, establish a durable context object ( The function comments in the go std library for
Ref: I don't think we benefit from updating the existing local Curious about other thoughts as well here. |
That's a good point, we should pass contexts down the line for better handling. 👍 |
Hey, if you want to pass down a context, would you also want some kind of mechanism to manage the go routines started in the |
Propagate a context from the main function to wherever it is needed. Use `github.com/oklog/run` run groups to handle the life cycle of the go routines running the rebooter and metrics server. Ref: kubereboot#234 and kubereboot#808 Signed-off-by: leonnicolas <[email protected]>
Kured is so lightweight and simple... I think we need to explain why we really want to do that. I agree with @jackfrancis overall. Context.background is a step towards a direction, which I can agree with, but I am not entirely sold either... I commented on @leonnicolas , which is a very good PR to get the ball rolling to "do the right thing". I would prefer if everyone sees and understand the benefits, as it adds a bit of complexity, for a not very big "business" value for kured, IMO. Except if I missed something big? Explaining said value would be useful to help me review this. |
Propagate a context from the main function to wherever it is needed. Use `github.com/oklog/run` run groups to handle the life cycle of the go routines running the rebooter and metrics server. Ref: kubereboot#234 and kubereboot#808 Signed-off-by: leonnicolas <[email protected]>
I noticed that you added context arguments to the k8s API calls in 1610901 - but you used context.TODO() instead of propagating a context object.
context.TODO() signals that this will be changed at some point - do have any plans to do so?
Otherwise, it would be more appropriate to use context.Background() instead.
The text was updated successfully, but these errors were encountered: