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
Manager runnableGroup causes a disconnect between contexts #1817
Comments
Hi @aphistic , I used to explain why we don't create contexts of runnable based on the same parent context in #1752 (comment) Please feel free to optimize it, but keep in mind that we should keep the stop order of different types of runnables :) |
Ahh, I see! Sorry I missed that issue when I was searching originally. =/
What would you think about a |
Yeah, I'm ok with that. If the |
I just ran into this - I'd love to see a |
I was waiting to see if @vincepri had any thoughts on it before making a PR, but I could probably do a PR today sometime and we can talk about implementation and stuff in there! |
I was working on a Reconciler today and found that values I stored in the context passed to a Manager's
Start
method weren't available in theReconcile
context, so I started digging into it.I ended up tracking it down to the
runnableGroup
struct, and specifically this line in thenewRunnableGroup
function: https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/manager/runnable_group.go#L110It's creating an internal context for the group, but it's not being based on any other context. I looked through the code and couldn't find any code that references
r.ctx
orr.cancel
beforeStart
could be called, aside from theStopAndWait
method where it's callingr.cancel
.If the
Start
method is updated to setr.ctx
andr.cancel
inside ther.startOnce.Do
call with the context passed toStart
, it seems like the context from the initial managerStart
call is connected all the way to theReconcile
context. IfStopAndWait
is updated to check ifr.cancel
isnil
or not before it tries calling it I think it's possible to implement it safely.Is this intended functionality? It does seem like it works as expected the way the code is now, but is the intent to split the Manager's
Start
context from the ultimateReconcile
context?I was going to submit a PR for this, but I saw you request an issue to be created first, so that's what this is!
The text was updated successfully, but these errors were encountered: