RFR: 8308094: Add a compilation timeout flag to catch long running compilations [v5]

Manuel Hässig mhaessig at openjdk.org
Fri Aug 8 10:51:42 UTC 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:
>  - [x] Github Actions
>  - [x] 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)

Manuel Hässig has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:

 - Merge branch 'master' into JDK-8308094-timeout
 - Rename _timer
 - remove _timeout_armed
 - ASSERT
 - Merge branch 'master' into JDK-8308094-timeout
 - No acquire release semantics
 - Factor Linux specific timeout functionality out of share/
 - Move timeout disarm above if
 - Merge branch 'master' into JDK-8308094-timeout
 - Fix SIGALRM test
 - ... and 1 more: https://git.openjdk.org/jdk/compare/80c8bd84...8bb5eb7a

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/26023/files
  - new: https://git.openjdk.org/jdk/pull/26023/files/212afb4d..8bb5eb7a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26023&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26023&range=03-04

  Stats: 4769 lines in 139 files changed: 3372 ins; 855 del; 542 mod
  Patch: https://git.openjdk.org/jdk/pull/26023.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26023/head:pull/26023

PR: https://git.openjdk.org/jdk/pull/26023


More information about the hotspot-dev mailing list