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 (backport #518) #519

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot 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
}
```<hr>This is an automatic backport of pull request #518 done by [Mergify](https://mergify.com).

* 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
Copy link
Member

/build_test

Copy link

Workflow started at 6/13/2024, 5:00:27 PM. View Actions Run.

Copy link

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

@andrewazores andrewazores merged commit 97dac34 into cryostat-v3.0 Jun 13, 2024
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant