8268297: jdk/jfr/api/consumer/streaming/TestLatestEvent.java times out #68
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@egahlin This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 5 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
/integrate |
Going to push as commit 730f670.
Your commit was automatically rebased without conflicts. |
Hi,
Could I have a review of a fix that prevents a recording stream from dropping events/chunks.
This occurs when rotation happens quickly, as in TestLatestEvent.java, and the clock is not making progress, on Windows sometimes. The result is a chunk header with duration 0 ns, meaning there could be two chunks with the same start timestamp, which confuses the RecordingStream when determining iteration order.
The fix is to always increase the elapsed time by at least 1 ns. There were similar code prior to JDK 17, but it was removed because a mechanism was added in Java that makes sure a chunk always gets a unique Instant.now() timestamp. Unfortunately, that timestamp does not always correlate with what the JVM writes, which leads to intermittent failures in 2-4% of the time.
I also updated the test, so it can provide better information in case of new failures.
Testing:
test/jdk/jdk/jfr/api/consumer/streaming/TestLatestEvent.java 600 times without failure on Windows
test/jdk/jdk/jfr/ 6 times without failure on Mac, Linux and Windows.
Thanks
Erik
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk18 pull/68/head:pull/68
$ git checkout pull/68
Update a local copy of the PR:
$ git checkout pull/68
$ git pull https://git.openjdk.java.net/jdk18 pull/68/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 68
View PR using the GUI difftool:
$ git pr show -t 68
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk18/pull/68.diff