Integrated: 8287832: jdk/jfr/event/runtime/TestActiveSettingEvent.java failed with "Expected two batches of Active Setting events"

Markus Grönlund mgronlun at openjdk.org
Mon Oct 10 12:45:01 UTC 2022


On Wed, 5 Oct 2022 12:26:08 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

> Greetings,
> 
> The test fails because of an unexpected event in the event stream. The recording does not explicitly enable any events, yet, occasionally, there are some. From where do these events originate? The JfrEvent C++ classes check enabled state in the constructor, and some event instances have extent across a potential safepoint. A safepoint could result from JFR rotating and stopping to record. As a result, an event can still be enabled after JFR stops and then restarts, resulting in unexpected events in the event stream of the newly started recording.
> 
> Most common unexpected events seen are:
> 
> jdk.JavaMonitorWait
> jdk.Compilation
> jdk.NativeMethodSample
> 
> A solution to this problem is to move the event-enabled check from the constructor to the shouldCommit() and commit() functions. For durational events, it requires two is_enabled() tests, as one will still be needed in the constructor, for decision about starttime. No tangible performance impact is expected.
> 
> Testing: jdk_jfr, stress testing
> 
> Thanks
> Markus

This pull request has now been integrated.

Changeset: 4df4a1f8
Author:    Markus Grönlund <mgronlun at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/4df4a1f8e238ebf49d4b0e1e102ccdc3cdb82de9
Stats:     33 lines in 4 files changed: 10 ins; 11 del; 12 mod

8287832: jdk/jfr/event/runtime/TestActiveSettingEvent.java failed with "Expected two batches of Active Setting events"

Reviewed-by: egahlin

-------------

PR: https://git.openjdk.org/jdk/pull/10575


More information about the hotspot-jfr-dev mailing list