-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix(rules): refactor rules to become aware of jvmIds #1347
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andrewazores
reviewed
Feb 2, 2023
maxcao13
commented
Feb 2, 2023
src/main/java/io/cryostat/configuration/CredentialsManager.java
Outdated
Show resolved
Hide resolved
andrewazores
reviewed
Feb 2, 2023
src/main/java/io/cryostat/net/web/http/api/v2/RuleDeleteHandler.java
Outdated
Show resolved
Hide resolved
andrewazores
reviewed
Feb 2, 2023
Test image available:
|
andrewazores
reviewed
Feb 2, 2023
Test image available:
|
…e queries, added jvmId support for rules, fixed duplicate jvmId target filtering predicate func Signed-off-by: Max Cao <macao@redhat.com>
Test image available:
|
andrewazores
approved these changes
Feb 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
git commit --amend --signoff
Fixes: #1092
Description of the change:
Rules are not aware of jvmIds and will do operations more than once on targets if there exist more than one jvmId unique target within the discovery storage. This PR allows rules to do only do operations on jvmId unique targets with non-null jvmIds. This should work since the discovery storage is updated with non-null jvmIds whenever credentials are posted correctly and targets with the same jvmId are the same jvm.
However there is one problem in that when Cryostat restarts, the custom targets that are persisted never update their own jvmId when Cryostat comes back up, and so there will be a mismatch of jvmIds and the custom target will have a "stale" id. I'm not sure what is the best way to deal with this. Maybe on built-in discovery startup, test target connections for their jvmId again? I'm not too sure about the race conditions for that problem for now.
Motivation for the change:
JvmIds are unique to jvms. We don't want rule operations, for example deleting/stopping a recording, to apply more than once on a target jvm as that is extra overhead cost.
How to manually test: