-
Notifications
You must be signed in to change notification settings - Fork 226
feat: record desired state in Context #2922
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Chris Laprun <[email protected]>
I think we should agree that on these optimization issues we should see the numbers, so we can decide if it is worth it. But as we I think discussed before, there should be no blocking operation in desired state computation, that goes agains the pattern, calculating the desired (thus creating a pojo) is extremely fast - might be faster than getting a resource from a hash map (we need to measure), we should think though what we are actually optimizing with this. |
Agreed but it might also be a good idea to look at the different cache layers which are becoming too complex to properly maintain. |
Note that without this: |
Thinking about this some more, the memory usage should actually be minimal and there is no need to clean things because this isn't a new cache per se as the desired states are put in the |
if it does not survive the reconiliation, why to cache it? |
|
In what use case is the desired state cumputation costy? |
TBH I don't like the fact that we are calling the desired either - and by definition idempotent function. But I'm not convinced that this is the way to solving or should be solved in generic way, users are able to optimize that in some edge cases already. But this is not a strong opinion, so if we are able to solve this elegantly withing the Context I'm open for that. also maybe there is something I just don't see, so happy to dicuss further. Would be nice to see the users specific issue. |
private final ControllerConfiguration<P> controllerConfiguration; | ||
private final DefaultManagedWorkflowAndDependentResourceContext<P> | ||
defaultManagedDependentResourceContext; | ||
private final Map<DependentResource<?, P>, Object> desiredStates = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably should be removed.
Signed-off-by: Chris Laprun [email protected]