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 application occurs within DB transaction to ensure cursor is not closed prematurely #246

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Jan 18, 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: #245

Description of the change:

Annotate method with @Transactional to ensure the database cursor/connection is not prematurely closed.

Motivation for the change:

See #245

How to manually test:

See #245
Also try:

{
  "name": "test",
  "description": "",
  "matchExpression": "!target.connectUrl.startsWith('http')",
  "eventSpecifier": "template=Profiling,type=TARGET",
  "archivalPeriodSeconds": 15,
  "initialDelaySeconds": 0,
  "preservedArchives": 3,
  "maxAgeSeconds": 0,
  "maxSizeBytes": 10485760,
  "enabled": false,
  "recordingName": "auto_test"
}

Upload this rule definition and enable it. Recordings should be started within a few seconds, and then every 15 seconds afterward should be archived, and once there are 3 copies of each, the oldest copies should start rolling over and getting deleted.

@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 1/18/2024, 4:20:42 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7576110725

1 similar comment
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7576110725

@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 1/19/2024, 3:13:06 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7588694451

1 similar comment
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7588694451

Copy link
Member

@mwangggg mwangggg left a comment

Choose a reason for hiding this comment

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

looks good

@andrewazores andrewazores merged commit 53ea034 into cryostatio:main Jan 19, 2024
8 checks passed
@andrewazores andrewazores deleted the rule-transaction branch January 19, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
2 participants