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

Markus Grönlund mgronlun at openjdk.org
Fri Oct 7 11:02:29 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

Markus Grönlund has updated the pull request incrementally with one additional commit since the last revision:

  update

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10575/files
  - new: https://git.openjdk.org/jdk/pull/10575/files/4751fdab..465671a1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10575&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10575&range=00-01

  Stats: 7 lines in 1 file changed: 2 ins; 0 del; 5 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