Skip to content

fix(gc): clean up tracking entities after operation completes - #1709

Merged
andrewazores merged 2 commits into
cryostatio:mainfrom
andrewazores:gc-entity
Jul 27, 2026
Merged

fix(gc): clean up tracking entities after operation completes#1709
andrewazores merged 2 commits into
cryostatio:mainfrom
andrewazores:gc-entity

Conversation

@andrewazores

Copy link
Copy Markdown
Member

Welcome to Cryostat! 👋

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: #1708

Description of the change:

Ensures that the GarbageCollection entity is deleted after a gc request completes. This entity is only intended to track gc invocations for the audit log - the entity doesn't encode any information or even carry any specific metadata than the universal audit log metadata (timestamp, link to target ID, name of requesting client/user). Prior to this change both the primary GarbageCollection table and its GarbageCollection_AUD audit log would gain/retain a new row each time a GC request was serviced. The primary table should generally be empty in this case and only the audit log should retain a historical log.
This also adds an event listener to catch target loss and ensure that no dangling ThreadDump, HeapDump, or AsyncProfilerRecording tracking entities are left behind. These already do normally have a deletion in their lifecycle, but if the associated target is unexpectedly lost while an operation is underway then the tracking entities could be left behind stale forever.

@andrewazores

Copy link
Copy Markdown
Member Author

/build_test

@github-actions

Copy link
Copy Markdown

Workflow started at 7/27/2026, 10:20:53 AM. View Actions Run.

@github-actions

Copy link
Copy Markdown

No OpenAPI schema changes detected.

No GraphQL schema changes detected.

No WebSocket notifications schema changes detected.

@github-actions

Copy link
Copy Markdown

CI build:
Integration tests pass ✅
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
https://github.com/cryostatio/cryostat/actions/runs/30274614402

@github-actions

Copy link
Copy Markdown

CI build:
Unit tests pass with flaky tests ⚠️
Tests run: 663, Failures: 0, Errors: 0, Skipped: 108, Flakes: 1

Flaky tests:

@mergify

mergify Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@andrewazores
andrewazores merged commit 011fce5 into cryostatio:main Jul 27, 2026
15 checks passed
@andrewazores
andrewazores deleted the gc-entity branch July 27, 2026 19:00
andrewazores added a commit that referenced this pull request Jul 27, 2026
andrewazores added a commit that referenced this pull request Jul 29, 2026
#1709) (#1716)

* fix(gc): clean up tracking entities after operation completes (#1709)

(cherry picked from commit 011fce5)

* schema

---------

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

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] GarbageCollection tracking entities are never deleted

2 participants