mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 08:08:02 +01:00
Catch IllegalStateException when closing RecordingStream
This commit is contained in:
committed by
ravi-signal
parent
bad2602491
commit
3cf194e476
@@ -68,7 +68,14 @@ public class VirtualThreadPinEventMonitor implements Managed {
|
||||
@Override
|
||||
public void stop() throws InterruptedException {
|
||||
// flushes events and waits for callbacks to finish
|
||||
recordingStream.stop();
|
||||
try {
|
||||
recordingStream.stop();
|
||||
} catch (final IllegalStateException _) {
|
||||
// The JFR recorder registers its own shutdown hook with the JVM.
|
||||
// Since shutdown hook execution order is not guaranteed but JFR's hook usually runs early,
|
||||
// this recording may already be stopped before our managed resource cleanup runs.
|
||||
logger.info("RecordingStream already stopped");
|
||||
}
|
||||
// immediately frees all resources
|
||||
recordingStream.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user