RFR: 7903526: jtreg should handle all exceptions [v2]
Leonid Mesnik
lmesnik at openjdk.org
Wed Nov 1 03:28:39 UTC 2023
On Wed, 1 Nov 2023 00:24:08 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>>> Finally, the major issue with setting a JVM level uncaught exception handler is that, tests will no longer be able to expect the Thread.getDefaultUncaughtExceptionHandler() to ever be null, even if they launch in /othervm mode. I think that's a problem. I can't recollect if jtreg testing framework has other similar cases where it interferes with the tests even with the usage of /othervm.
>>
>> I don't think it is a major issue. It might be useful to document this, so tests don't expect global UHE to be null. They could re-write UHE if they need and don't need to preserve/restore the original one.
>
>> However, I think we shouldn't silently ignore any of the unhandled exceptions. Some exceptions are already handled using ThreadGroup
>
> Do you mean there are uncaught exceptions that aren't currently being handled/reported by jtreg when using platform thread?
I hope that we don't have. Most of test platform threads should inherit MainGroup. However, I don't know if it is true for all pools and executors implementations. And there are JDK internal threads (Managment, JVMCi, Debugger, UI, JFR and other). I hope that they handle exceptions, but haven't checked really all of them. The goal of this fix to ensure that we don't miss any of them if they were thrown during test execution.
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/172#discussion_r1378356155
More information about the jtreg-dev
mailing list