RFR: JDK-8305507 Add support for grace period before AbortVMOnSafepointTimeout triggers [v2]

Wojciech Kudla duke at openjdk.org
Fri Apr 28 16:37:55 UTC 2023


On Thu, 27 Apr 2023 06:34:53 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Please add a new testcase for this to test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java

Test case added

> src/hotspot/share/runtime/safepoint.cpp line 788:
> 
>> 786:   // To debug the long safepoint, specify both AbortVMOnSafepointTimeout &
>> 787:   // ShowMessageBoxOnError.
>> 788:   if (AbortVMOnSafepointTimeout && Management::ticks_to_ms(os::elapsed_counter()) > (jlong)AbortVMOnSafepointTimeoutDelay) {
> 
> Rather than use the Management API here perhaps just:
> 
> if (AbortVMOnSafepointTimeout
>     && (os::elapsedTime() * MILLIUNITS > AbortVMOnSafepointTimeoutDelay)) {
> 
> ?

To my understanding `os::elapsedTime() * MILLIUNITS` will reduce the granularity of the grace period down to a second but I fully agree this is nicer and we don't need millis for this functionality. 
Thank you for the suggestion, @dholmes-ora

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

PR Comment: https://git.openjdk.org/jdk/pull/13386#issuecomment-1527800945
PR Review Comment: https://git.openjdk.org/jdk/pull/13386#discussion_r1180602262


More information about the hotspot-runtime-dev mailing list