When the JVM rotates to a new chunk, a notified flag is set. This is so an ongoing Java event can redo the event with a stack trace ID that is present in the new chunk. This means the logic in the commit method is executed twice.
Currently there is a check if the startTime has been set.
In the first iteration, it's zero, indicating an event without a duration.
In the second iteration, it's no longer zero, and the code incorrectly assumes this was because the user called begin(), so it complete the event with a duration. This leads to events with a small duration, typically a few microseconds.
This is a regression introduced in JDK 19. SeeJDK-8282420 JFR: Remove event handlers. Previously the repetition happened in a separate method, meaning the startTime was a new stack variable instead of a field value, so it never occurred.
Impact: Medium, no dataloss but could potentially break program that expects the duration to be zero.
Likelihood: High, likely to happen in a longer recording if JFR is being used
Workaround: High, no known workaround
MHH => P2
Currently there is a check if the startTime has been set.
In the first iteration, it's zero, indicating an event without a duration.
In the second iteration, it's no longer zero, and the code incorrectly assumes this was because the user called begin(), so it complete the event with a duration. This leads to events with a small duration, typically a few microseconds.
This is a regression introduced in JDK 19. See
Impact: Medium, no dataloss but could potentially break program that expects the duration to be zero.
Likelihood: High, likely to happen in a longer recording if JFR is being used
Workaround: High, no known workaround
MHH => P2