RFR: 8365066: RecordingStream and RemoteRecordingStream do not terminate when the associated Recording is stopped or closed externally
Chihiro Ito
cito at openjdk.org
Thu Aug 21 14:38:02 UTC 2025
On Sat, 9 Aug 2025 04:50:26 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
>> Fix an issue where RecordingStream and RemoteRecordingStream do not stop when their underlying the local/remote recording stop.
>>
>> Introduce an internal EventSource abstraction to unify control across local (PlatformRecording) and remote (FlightRecorderMXBean) recordings, ensuring consistent propagation of stop/close and stop time to the consumer streams.
>>
>> Tests updated to validate lifecycle consistency:
>> Verifies that stopping/closing the underlying recording (local and remote) properly stops/closes the corresponding stream.
>>
>> Test: jdk/jdk/jfr
>
> Did you look into adding a FlightRecorderListener and implementing recordingStateChanged to check if the RecordingState is CLOSED and then call close() on the stream? Or perhaps it would be better to set a flag and let the thread running the stream close itself after the next flush is complete.
>
> For a RemoteRecordingStream there is a JMX notification that can be listened on.
@egahlin
Could you please review this please?
I added a listener-based mechanism that propagates external stop/close to the stream.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26710#issuecomment-3210871547
More information about the hotspot-jfr-dev
mailing list