-
Notifications
You must be signed in to change notification settings - Fork 509
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
Proposal: Add Node to OnStreamClosed and OnDeltaStreamClosed of Callbacks #569
Comments
This would be particularly handy when using
In our control plane, a lot of implementation of That being said I think we can do better than just passing the node to
Then offer a something to implement the xDS callbacks via this interface:
This would significantly decrease the complexity of basic control plane functionalities that just call |
I think this is a reasonable addition to the callbacks interface. If you'd like to open a PR that makes this change i'd be happy to review. |
@atollena I'm using a similar solution to track connected nodes like yours(map & callbacks).
@alecholmez I can open a PR for this soon. |
I've been actually thinking about this quite a lot recently and I'm thinking go-control-plane could benefit from a better node management system. It seems quite a few control-plane implementations are having to manage their own node association layers so moving that logic upstream might be beneficial to a large user base. If you guys want to open a PR for that logic I'd be more than happy to review that. I would just recommend to make sure its generic enough where it can support different cache implementations. On the other hand we may not even want to overload the callbacks. It could very well be worth introducing a new subsystem to track the proxy registration. What do you guys think about that? I think having the callbacks stay pretty tied to the stream lifecycle is rather user friendly. |
@alecholmez I agree that we need to manage nodes in a better way without overloading the callbacks. I don't have a mature idea now but will post it if I have something to discuss. |
When we implement a control plane, we may need to watch resources like k8s Ingress/Gateway using k8s informer. To save cpu and memory, we only want to watch specific the resources we care about. Then we can start watching when we get a request and stop watching when the stream closes. With current Callbacks interface, we can start watching in (the first)
OnStreamRequest
(take sotw for an example) usingNode
inDiscoveryRequest
, but we can't stop watching inOnStreamClosed
because the params of doesn't have theNode
.So I propose adding Node to
OnStreamClosed
andOnDeltaStreamClosed
, like:Any idea about the proposal? Or maybe there are other solutions to achieve this?
If this is a good idea, I can send a PR for this. But this will be a breaking change :(
The text was updated successfully, but these errors were encountered: