Skip to content

fix(recording): already-stopped external recordings should be archived immediately (backport #1674)#1681

Open
mergify[bot] wants to merge 2 commits into
cryostat-v4.2from
mergify/bp/cryostat-v4.2/pr-1674
Open

fix(recording): already-stopped external recordings should be archived immediately (backport #1674)#1681
mergify[bot] wants to merge 2 commits into
cryostat-v4.2from
mergify/bp/cryostat-v4.2/pr-1674

Conversation

@mergify

@mergify mergify Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

Description of the change:

Cryostat detects "external" recordings on targets - ones that were started by some other mechanism than Cryostat initiating them. -XX:StartFlightRecording would be a common source. When these are detected and if they have a fixed duration, Cryostat sets up a timed job to run when the recording ends so that Cryostat can update the database entity representing that recording, as well as to copy the recording content to archives.

Critically, the current implementation filters out detected recordings that have a fixed duration that has already elapsed and is already STOPPED. In that case, the database entity representing the recording is correctly in the STOPPED state, but the job for archiving the recording wouldn't be scheduled. If the user doesn't manually archive that recording or take some other action to preserve the data, then the recorded data would be lost.

How to manually test:

  1. Check out and build PR
  2. ./smoketest.bash -O -t gameserver to run a sample application that has three -XX:StartFlightRecording examples: one with 10s duration, one 30s, and one continuous. This application's Agent registration will take some time, longer than 10 seconds, so by the time the application is discovered by Cryostat at least one recording will have already completed and will be initially synched in the STOPPED state. Prior to this patch this recording would never be automatically archived, but now it should be ~2 seconds after the target is discovered.
    This is an automatic backport of pull request fix(recording): already-stopped external recordings should be archived immediately #1674 done by Mergify.

@andrewazores andrewazores force-pushed the mergify/bp/cryostat-v4.2/pr-1674 branch from 1e8eef0 to 77616cf Compare June 30, 2026 20:43
@andrewazores

Copy link
Copy Markdown
Member

/build_test

@github-actions

Copy link
Copy Markdown

Workflow started at 6/30/2026, 4:44:30 PM. View Actions Run.

@andrewazores

Copy link
Copy Markdown
Member

/build_test

@github-actions

Copy link
Copy Markdown

Workflow started at 6/30/2026, 4:46:31 PM. View Actions Run.

@andrewazores andrewazores requested a review from a team June 30, 2026 21:06
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.

1 participant