gnodet commented on code in PR #24491:
URL: https://github.com/apache/camel/pull/24491#discussion_r3536663880
##########
core/camel-console/src/main/java/org/apache/camel/impl/console/JfrMemoryLeakDevConsole.java:
##########
@@ -165,6 +165,7 @@ private synchronized JsonObject doStart(Map<String, Object>
options) {
}
return result;
} catch (Exception e) {
+ rec.close();
LOG.warn("Failed to start JFR recording: {}", e.getMessage(), e);
return errorJson("Failed to start JFR recording: " +
e.getMessage());
}
Review Comment:
Good catch — addressed in 7ad8d99. The catch block now resets
`activeRecording`, `recordingStartTime`, and `requestedDurationSeconds`, and
cancels any scheduled auto-stop before closing the recording. This prevents the
console from getting stuck referencing a closed `Recording` if the exception
occurs after `activeRecording = rec` (e.g. during auto-stop scheduling).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]