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

Markus Grönlund mgronlun at openjdk.org
Wed Oct 5 12:33:46 UTC 2022


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

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

Commit messages:
 - 8287832

Changes: https://git.openjdk.org/jdk/pull/10575/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10575&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8287832
  Stats: 31 lines in 4 files changed: 8 ins; 11 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/10575.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10575/head:pull/10575

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


More information about the hotspot-jfr-dev mailing list