cryostatio / cryostat

Other
7 stars 8 forks source link

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

Closed mergify[bot] closed 2 weeks ago

mergify[bot] commented 2 weeks ago

Welcome to Cryostat3! 👋

Before contributing, make sure you have:

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).
andrewazores commented 2 weeks ago

/build_test

github-actions[bot] commented 2 weeks ago

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

github-actions[bot] commented 2 weeks ago

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