Skip to content
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): rule archiving and re-activation bugfixes #518

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Jun 13, 2024

Welcome to Cryostat3! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes: #517

Description of the change:

Fixes up some issues that arose due to previous refactorings, where collections were improperly modified during traversal, or methods went from blocking operations to returning Unis which went ignored, or active recordings were improperly left running, or duplicate target definitions were not de-duplicated by JVM ID and thus were acted on multiple times.

How to manually test:

  1. Check out and build PR
  2. ./smoketest.bash -Ot
  3. Create an automated rule using the JSON below
  4. Verify that targets have the active recording created and started
  5. Verify that rule archives copies, then prunes extras later
  6. Disable rule with clean option checked and ensure recordings are stopped
  7. Re-enable rule and ensure recordings are restarted
{
  "id": 1,
  "name": "test",
  "description": "",
  "matchExpression": "target.connectUrl.startsWith('service') && target.jvmId != null",
  "eventSpecifier": "template=Continuous,type=TARGET",
  "archivalPeriodSeconds": 20,
  "initialDelaySeconds": 0,
  "preservedArchives": 2,
  "maxAgeSeconds": 0,
  "maxSizeBytes": 26214400,
  "enabled": true
}

@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 6/13/2024, 11:06:57 AM. View Actions Run.

Copy link

CI build and push: All tests pass ✅ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/9502125197

@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 6/13/2024, 11:20:08 AM. View Actions Run.

Copy link

No OpenAPI schema changes detected.

Copy link

No GraphQL schema changes detected.

Copy link

CI build and push: All tests pass ✅ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/9502341883

@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 6/13/2024, 2:57:40 PM. View Actions Run.

Copy link

No GraphQL schema changes detected.

Copy link

No OpenAPI schema changes detected.

Copy link

CI build and push: All tests pass ✅ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/9505241368

Copy link
Member

@ebaron ebaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described

@andrewazores andrewazores merged commit 233df2a into cryostatio:main Jun 13, 2024
8 of 9 checks passed
@andrewazores andrewazores deleted the gh517 branch June 13, 2024 20:57
@andrewazores
Copy link
Member Author

@Mergifyio backport cryostat-v3.0

Copy link

mergify bot commented Jun 13, 2024

backport cryostat-v3.0

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jun 13, 2024
* fix(rules): rule archiving and re-activation bugfixes

* refactor

* blocking

* activate concurrently

* cancel job when target disappears

* fixup! cancel job when target disappears

* apply existing rules to newly appearing targets

(cherry picked from commit 233df2a)
andrewazores added a commit that referenced this pull request Jun 13, 2024
…#519)

fix(rules): rule archiving and re-activation bugfixes (#518)

* fix(rules): rule archiving and re-activation bugfixes

* refactor

* blocking

* activate concurrently

* cancel job when target disappears

* fixup! cancel job when target disappears

* apply existing rules to newly appearing targets

(cherry picked from commit 233df2a)

Co-authored-by: Andrew Azores <me@andrewazor.es>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] Automated Rules fail to archive recordings
2 participants