RFR: 8166554: Avoid compilation blocking in OverloadCompileQueueTest.java [v2]
Evgeny Nikitin
enikitin at openjdk.java.net
Mon Sep 7 20:56:01 UTC 2020
On Mon, 7 Sep 2020 13:11:07 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Evgeny Nikitin has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Interrupt LockUnlockThread before test finish, fix coding style issues.
>
> test/hotspot/jtreg/compiler/codecache/stress/OverloadCompileQueueTest.java line 82:
>
>> 80:
>> 81: public class OverloadCompileQueueTest implements Runnable {
>> 82: private static final LockUnlockThread lockUnlockThread = new LockUnlockThread();
>
> `static final` field should be `LOCK_UNLOCK_THREAD`?
Fixed by moving the static field into the 'main' method (thus making it function-local)
> test/hotspot/jtreg/compiler/codecache/stress/OverloadCompileQueueTest.java line 74:
>
>> 72: }
>> 73: } catch (InterruptedException e) {
>> 74: throw new Error("TESTBUG: lockUnlocker thread was unexpectedly interrupted", e);
>
> Since `lockUnlocker` method is gone, the message should be "LockUnlockThread was unexpectedly interrupted"?
>
> Also, throwing the error from this thread would not be rethrown with `join` later. If we care about this error, should
> we instead store it into `static final` field here, check it after `join`, and rethrow if ` != null`. The old code
> seems to have the same problem, though, so we can keep ignoring it.
Fixed the message. Regarding the error - it is an Error, not a Throwable, it gets noticed and recorded by the jtreg (I
checked that).
> test/hotspot/jtreg/compiler/codecache/stress/OverloadCompileQueueTest.java line 114:
>
>> 112:
>> 113: lockUnlockThread.isActive = false;
>> 114: lockUnlockThread.join();
>
> So this now relies on `lockUnlockThread` unblocking from its `Thread.sleep`-s, and then `joining` here? We could wait
> here for up to `MAX_SLEEP` seconds then? Maybe we should command `lockUnlockThread.interrupt()` before `join()` to make
> the test a tad faster?
Added an interrupt, thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/46
More information about the hotspot-compiler-dev
mailing list