Skip to content

Commit

Permalink
fixup! ensure recording dumps to exit path
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Oct 3, 2023
1 parent 5785733 commit 3ed5daf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/io/cryostat/agent/harvest/Harvester.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ public void recordingStateChanged(Recording recording) {
case RUNNING:
break;
case STOPPED:
try {
trackedRecording.dump(exitPaths.get(trackedRecording));
} catch (IOException e) {
log.error("Failed to dump recording to file", e);
}
if (isSownRecording) {
recording.close();
}
Expand All @@ -228,7 +233,6 @@ public void recordingStateChanged(Recording recording) {
Path exitPath =
exitPaths.remove(trackedRecording);
recordings.remove(trackedRecording);
trackedRecording.dump(exitPath);
uploadDumpedFile(exitPath).get();
Files.deleteIfExists(exitPath);
log.trace("Deleted temp file {}", exitPath);
Expand Down

0 comments on commit 3ed5daf

Please sign in to comment.