RFR: 8284686: Interval of < 1 ms disables ExecutionSample events [v6]
Johannes Bechberger
duke at openjdk.java.net
Thu May 5 13:11:19 UTC 2022
On Thu, 5 May 2022 13:04:04 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:
>> Johannes Bechberger has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Add TestShortPeriod
>> - Remove TestPeriodSetting
>
> test/jdk/jdk/jfr/api/recording/event/TestShortPeriod.java line 63:
>
>> 61: try (var r = new RecordingStream()) {
>> 62: r.enable(EventNames.JVMInformation).withPeriod(Duration.ofNanos(1));
>> 63: r.onEvent(e -> r.close());
>
> What happens when the event is, in fact, disabled?
> The test will run forever, right?
>
> Could you rather use something like `CountDownLatch` which will get decremented in `onEvent()` handler and the test method would wait for that latch for at most N milliseconds - failing when the wait times out?
I could, but lets ask @egahlin for his opinion. He proposed it in the first place.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8183
More information about the hotspot-jfr-dev
mailing list