RFR: 8360702: runtime/Thread/AsyncExceptionTest.java timed out [v2]
Patricio Chilano Mateo
pchilanomate at openjdk.org
Fri Oct 3 15:02:50 UTC 2025
On Fri, 3 Oct 2025 06:18:50 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>>
>> David's comments
>
> test/hotspot/jtreg/runtime/Thread/AsyncExceptionOnMonitorEnter.java line 95:
>
>> 93: throw new Error("Unexpected: " + e);
>> 94: } finally {
>> 95: exitRawMonitor();
>
> This isn't quite right. If we have the exit in the finally block then it should be deleted from the main block. But we also need the enter to be outside the scope of the try-catch-finally incase we abort before entering the raw monitor. Not worth wasting time on this part - just restore it to how it was.
Right, but removing it from the main block would have the same potential deadlock, that’s why I checked calling exitRawMonitor just returns an error if not the owner. Unless we also wrap the Thread.sleep() call in a while true loop, and call exitRawMonitor in the finally block only for worker1. That would replace a possible error returned by exitRawMonitor with never releasing for worker2. The good thing about stopping worker1 too is that we don’t have to wait for the sleep call and can run many more iterations. Anyways, I kept it as it was without the finally block.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27582#discussion_r2402286585
More information about the hotspot-runtime-dev
mailing list