RFR: 8307486: ProcessTools.java should wait until vthread is completed before checking exceptions
David Holmes
dholmes at openjdk.org
Tue May 9 03:06:34 UTC 2023
On Tue, 9 May 2023 02:44:46 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
>> test/lib/jdk/test/lib/process/ProcessTools.java line 899:
>>
>>> 897: });
>>> 898: if (tg.uncaughtThrowable != null) {
>>> 899: throw new RuntimeException(tg.uncaughtThrowable);
>>
>> I think the wrapping with RuntimeException should be preserved because the uncaughtThrowable was thrown in a different thread and we want an exception that is thrown in the current thread.
>
> I removed 'new RuntimeException' to make the exception chain more similar to the original one. This exception is thrown by method main() and not going to be handled but printed only. The test which tries to search the exception in the output of a spawned process by classname might be confused if found 'RuntimeException' instead of the expected one.
Surely any such tests would have failed by now if that were the case? Propagating an exception in one thread when the exception was actually generated and thrown in another is normally considered a source of confusion.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13873#discussion_r1188068073
More information about the hotspot-dev
mailing list