RFR: 8307486: ProcessTools.java should wait until vthread is completed before checking exceptions

Leonid Mesnik lmesnik at openjdk.org
Tue May 9 02:47:25 UTC 2023


On Tue, 9 May 2023 02:30:38 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Updated processtools to check exception after join().
>> 
>> Tested with running CI virtual thread tests.
>
> 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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13873#discussion_r1188060454


More information about the hotspot-dev mailing list