Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

8268297: jdk/jfr/api/consumer/streaming/TestLatestEvent.java times out #68

Closed
wants to merge 1 commit into from

Conversation

egahlin
Copy link
Member

@egahlin egahlin commented Dec 23, 2021

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

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8268297: jdk/jfr/api/consumer/streaming/TestLatestEvent.java times out

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 23, 2021

👋 Welcome back egahlin! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 23, 2021

@egahlin The following label will be automatically applied to this pull request:

  • hotspot-jfr

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-jfr hotspot-jfr-dev@openjdk.java.net label Dec 23, 2021
@egahlin egahlin marked this pull request as ready for review December 23, 2021 05:35
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 23, 2021
@mlbridge
Copy link

mlbridge bot commented Dec 23, 2021

Webrevs

Copy link

@mgronlun mgronlun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@openjdk
Copy link

openjdk bot commented Dec 23, 2021

@egahlin This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8268297: jdk/jfr/api/consumer/streaming/TestLatestEvent.java times out

Reviewed-by: mgronlun

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 master branch:

  • 9d5ae2e: 8279076: C2: Bad AD file when matching SqrtF with UseSSE=0
  • 04ee921: 8278967: rmiregistry fails to start because SecurityManager is disabled
  • 2be3e7e: 8278239: vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine failed with EXCEPTION_ACCESS_VIOLATION at 0x000000000000000d
  • dfb15c3: 8274315: JFR: One closed state per file or stream
  • e49d4a9: 8271447: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 23, 2021
@egahlin
Copy link
Member Author

egahlin commented Dec 23, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Dec 23, 2021

Going to push as commit 730f670.
Since your change was applied there have been 5 commits pushed to the master branch:

  • 9d5ae2e: 8279076: C2: Bad AD file when matching SqrtF with UseSSE=0
  • 04ee921: 8278967: rmiregistry fails to start because SecurityManager is disabled
  • 2be3e7e: 8278239: vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine failed with EXCEPTION_ACCESS_VIOLATION at 0x000000000000000d
  • dfb15c3: 8274315: JFR: One closed state per file or stream
  • e49d4a9: 8271447: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 23, 2021
@openjdk openjdk bot closed this Dec 23, 2021
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 23, 2021
@openjdk
Copy link

openjdk bot commented Dec 23, 2021

@egahlin Pushed as commit 730f670.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-jfr hotspot-jfr-dev@openjdk.java.net integrated Pull request has been integrated
2 participants