Skip to content

8308094: Add a compilation timeout flag to catch long running compilations #26023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mhaessig
Copy link
Contributor

@mhaessig mhaessig commented Jun 27, 2025

This PR adds -XX:CompileTaskTimeout on Linux to limit the amount of time a compilation task can run. The goal of this is initially to be able to find and investigate long-running compilations.

The timeout is implemented using a POSIX timer that sends a SIGALRM to the compiler thread the compile task is running on. Each compiler thread registers a signal handler that triggers an assert upon receiving SIGALRM. This is currently only implemented for Linux, because it relies on SIGEV_THREAD_ID to get the signal delivered to the same thread that timed out.

Since SIGALRM is now used, the test runtime/signal/TestSigalrm.java now requires vm.flagless so it will not interfere with the compiler thread signal handlers.

Testing:

  • Github Actions
  • tier1, tier2 on all platforms
  • tier3, tier4 and Oracle internal testing on Linux fastdebug
  • tier1 through tier4 with -XX:CompileTaskTimeout=60000 (one minute timeout) to see what fails (compiler/codegen/TestAntiDependenciesHighMemUsage2.java, compiler/loopopts/TestMaxLoopOptsCountReached.java, and compiler/c2/TestScalarReplacementMaxLiveNodes.java fail)

Progress

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

Issue

  • JDK-8308094: Add a compilation timeout flag to catch long running compilations (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26023

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 27, 2025

👋 Welcome back mhaessig! 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 Jun 27, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Jun 27, 2025

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

  • hotspot

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 hotspot-dev@openjdk.org label Jun 27, 2025
@mhaessig mhaessig marked this pull request as ready for review June 27, 2025 17:55
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 27, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 27, 2025

Webrevs

@mhaessig
Copy link
Contributor Author

/label add hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jun 27, 2025
@openjdk
Copy link

openjdk bot commented Jun 27, 2025

@mhaessig
The hotspot-compiler label was successfully added.

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-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant