RFR: 7903526: jtreg should handle all exceptions [v2]
Leonid Mesnik
lmesnik at openjdk.org
Tue Oct 31 20:47:04 UTC 2023
On Tue, 31 Oct 2023 20:01:39 GMT, Leonid Mesnik <lmesnik 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`.
>
> No, the plan is to catch all unhandled exceptions. The virtual threads are only a particular case but might be the most common. However, I think we shouldn't silently ignore any of the unhandled exceptions. Some exceptions are already handled using ThreadGroup, and the fix doesn't break this, just add more handling.
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/172#discussion_r1378110656
More information about the jtreg-dev
mailing list