[crac] RFR: 8328344: [CRaC] Avoid error when running with -XX:+PerfDisableSharedMem [v2]

Volker Simonis simonis at openjdk.org
Tue Mar 19 19:41:47 UTC 2024


On Tue, 19 Mar 2024 15:14:07 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> Volker Simonis has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Added test for -XX:+/-PerfDisableSharedMem
>
> test/jdk/jdk/crac/PerfMemoryRestoreTest.java line 69:
> 
>> 67:         while (!perfdata.toFile().exists()) {
>> 68:             if (System.nanoTime() - start > TimeUnit.SECONDS.toNanos(10)) {
>> 69:                 if (perfDisableSharedMem) {
> 
> The file won't ever appear, so this would busy loop for the whole 10 seconds, extending the testsuite. Could you avoid the loop completely, or in case of `perfDisableSharedMem == true` reduce the delay to, say, 100 ms?

If we expect that the file will appear we give it up to ten seconds to appear. If we want to be sure that it doesn't appear, we should then wait at least as long, right? Now for the positive case we expect that the file will appear quickly, so sleeping for a small amount of time like 10ms is fine. For the negative case, we already know that we will have to wait for the full ten seconds anyway, so we can just do that and not loop at all by sleeping 10 seconds.

I'll change the sleep time accordingly.

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

PR Review Comment: https://git.openjdk.org/crac/pull/153#discussion_r1530978466


More information about the crac-dev mailing list