RFR: 8308094: Add a compilation timeout flag to catch long running compilations [v2]
Manuel Hässig
mhaessig at openjdk.org
Tue Aug 5 08:55:06 UTC 2025
On Tue, 5 Aug 2025 03:56:41 GMT, Dean Long <dlong at openjdk.org> wrote:
>> 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 three additional commits since the last revision:
>>
>> - Merge branch 'master' into JDK-8308094-timeout
>> - Fix SIGALRM test
>> - Add timeout functionality to compiler threads
>
> src/hotspot/share/compiler/compilerThread.cpp line 97:
>
>> 95: switch (signo) {
>> 96: case TIMEOUT_SIGNAL: {
>> 97: assert(!Atomic::load_acquire(&_timeout_armed), "compile task timed out");
>
> Why do we need acquire? Only the current thread is ever going to be looking at this value, right?
The compiler thread setting and unsetting the flag and the signal handler reading the flag are racing each other as soon as the timer is set, since signals are preemptive. This prevents a few false positive timeouts on architectures with weak memory models, but does not have any effect on x86 for example.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26023#discussion_r2253611427
More information about the hotspot-dev
mailing list