Skip to content

8390661: gc/TestGCALotAtSafepoints sub-tests times out - #32478

Closed
tschatzl wants to merge 4 commits into
openjdk:masterfrom
tschatzl:submit/9390661-more-hangs-with-gcalot
Closed

8390661: gc/TestGCALotAtSafepoints sub-tests times out#32478
tschatzl wants to merge 4 commits into
openjdk:masterfrom
tschatzl:submit/9390661-more-hangs-with-gcalot

Conversation

@tschatzl

@tschatzl tschatzl commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Hi all,

the tests in JDK-8389096 discovered more hangs with . There were two main causes:

  • the place where the previous place allowed GC after logical release of a monitor but before releasing the OS monitor in some cases is too weak, there are a few potential cases where a deadlock could happen due to indirect monitor uses. The solution is to just conservatively disable GC-alot GCs in this situation.
  • shutdown in particular had the issue where trying to do a GC-alot GC while we are shutting down would hang. One example is that Universe::before_exit() shuts down the GC, then other threads go into ::before_exit(). These threads trying to get - but the GC VM operation blocks if shutting down, so the VM will hang there.

The CI hangs were of the second sort. They were also confusing because jtreg reported that the test completed during timeout handling.

Testing: running the now un-problemlisted tests again for many times, no failure.

Hth,
Thomas



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8390661: gc/TestGCALotAtSafepoints sub-tests times out (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32478/head:pull/32478
$ git checkout pull/32478

Update a local copy of the PR:
$ git checkout pull/32478
$ git pull https://git.openjdk.org/jdk.git pull/32478/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32478

View PR using the GUI difftool:
$ git pr show -t 32478

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32478.diff

Using Webrev

Link to Webrev Comment

Hi all,

  after JDK-8389096 more hangs even with the tests provided earlier were discovered. There were two main causes:

* the place where the previous place allowed GC after logical release of a monitor but before releasing the OS monitor in some cases is too weak, there are a few potential cases where a deadlock could happen due to indirect monitor uses. The solution is to just conservatively disable GCs in this situation.
* shutdown in particular had the issue where trying to do a GC while we are shutting down (e.g. Universe::before_exit() shuts down the GC, then other threads go into ::before_exit(), trying to get some lock - but GC code blocks if shutting down, so the VM will hang there)

Testing: running the un-problemlisted tests again for many times, no failure.

Hth,
  Thomas
@bridgekeeper

bridgekeeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

👋 Welcome back tschatzl! 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

openjdk Bot commented Aug 21, 2026

Copy link
Copy Markdown

@tschatzl 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:

8390661: gc/TestGCALotAtSafepoints sub-tests times out

Reviewed-by: aboldtch, coleenp, ayang

You can use pull request commands such as /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 115 new commits pushed to 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 changed the title 9390661 9390661: Aug 21, 2026
@openjdk openjdk Bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Aug 21, 2026
@openjdk

openjdk Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

  • hotspot-runtime

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 commented Aug 21, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-runtime. This can be overridden with the /reviewers command.

@tschatzl tschatzl changed the title 9390661: 9390661 Aug 21, 2026
@openjdk openjdk Bot changed the title 9390661 9390661: Aug 21, 2026
@tschatzl tschatzl changed the title 9390661: 9390661 Aug 24, 2026
@openjdk openjdk Bot changed the title 9390661 9390661: Aug 24, 2026
@tschatzl tschatzl changed the title 9390661: 8390661 Aug 24, 2026
@openjdk openjdk Bot changed the title 8390661 8390661: gc/TestGCALotAtSafepoints sub-tests times out Aug 24, 2026
@openjdk openjdk Bot added the hotspot hotspot-dev@openjdk.org label Aug 24, 2026
@openjdk

openjdk Bot commented Aug 24, 2026

Copy link
Copy Markdown

@tschatzl hotspot has been added to this pull request based on files touched in new commit(s).

@tschatzl
tschatzl marked this pull request as ready for review August 25, 2026 06:54
@openjdk openjdk Bot added the rfr Pull request is ready for review label Aug 25, 2026
@mlbridge

mlbridge Bot commented Aug 25, 2026

Copy link
Copy Markdown

Webrevs

@tschatzl

Copy link
Copy Markdown
Contributor Author

/label add hotspot-gc

@openjdk openjdk Bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Aug 25, 2026
@openjdk

openjdk Bot commented Aug 25, 2026

Copy link
Copy Markdown

@tschatzl
The hotspot-gc label was successfully added.

Comment thread src/hotspot/share/runtime/mutex.cpp Outdated
Comment thread src/hotspot/share/runtime/java.cpp Outdated
Comment thread test/hotspot/jtreg/gc/TestGCALotAtAllSafepoints.java Outdated
* ayang review, DEBUG_ONLY -> NOT_PRODUCT
* improved logging to test, and general ScavengeALotInterval to decrease the potential amount of garbage collections
@tschatzl

Copy link
Copy Markdown
Contributor Author

As mentioned in another comment, we need to reduce the amount of GCs using -XX:ScavengeALotInterval for all configurations. Depending on the test setup it could otherwise cause timeouts due to running an excessively amount of gcs.

Tested with around ~7000 runs of the test, with no failure any more.

@xmas92 xmas92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm. Thanks for fixing.

@coleenp coleenp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good.

Comment thread src/hotspot/share/runtime/mutex.cpp
Comment thread src/hotspot/share/runtime/mutex.cpp
@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Aug 27, 2026
@tschatzl

Copy link
Copy Markdown
Contributor Author

Thanks @coleenp @albertnetymk @xmas92 for your reviews

/integrate

@openjdk

openjdk Bot commented Aug 28, 2026

Copy link
Copy Markdown

Going to push as commit 31f4e43.
Since your change was applied there have been 122 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Aug 28, 2026
@openjdk openjdk Bot closed this Aug 28, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 28, 2026
@openjdk

openjdk Bot commented Aug 28, 2026

Copy link
Copy Markdown

@tschatzl Pushed as commit 31f4e43.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org hotspot-gc hotspot-gc-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants