-
Notifications
You must be signed in to change notification settings - Fork 356
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
[WIP] Clear cache of MiqProductFeature to store MiqUserRole #5101
[WIP] Clear cache of MiqProductFeature to store MiqUserRole #5101
Conversation
Method rbac_compact_features is using cashe of for feaures (MiqProductFeature#feature_cache) It needs to be cleared out when newly added tenant product features are added.
Checked commit lpichler@f0a608c with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
This feels weird here...IIRC, the purpose of the cache was because features are static. If they are not (thinking about that new dynamic set of features), then I would expect clearing of the cache to be in the model itself, not in the UI. |
@Fryguy then are not static now, and clearing is done on model level but it is not working in production mode. Do you have any idea how it could be possible ? |
Is it possible that the code that clears the cache in the model is not being executed in the same process as the UI? Since the clear is tied to a callback. It may be problematic in general when there's more than 1 UI worker |
@gtanzillo yup, models are isolated from the controllers. I don't think you have access to the session from models without explicitly passing it, but I can dig into this if you want a precise answer. |
@skateman I want a precise answer :) |
thanks! and we found other solution #5108 |
Method rbac_compact_features called here is using cashe of feaures
(MiqProductFeature#feature_cache)
It needs to be cleared out when newly added tenant product features
are added.
even when it is cleared after tenant creation.
This is working locally in development mode and I am not sure why it is happening in product mode.
Anyway this PR is fixing this bug.
cc @gtanzillo @skateman
Reproducer:
Links
https://bugzilla.redhat.com/show_bug.cgi?id=1468795
@miq-bot add_label bug, blocker