On Thu, 18 Jun 2026 21:46:38 GMT, Serguei Spitsyn <[email protected]> wrote:
> The test does not handle exceptions, e.g. `InterruptedException`, in the > `Producer` and `Consumer` threads. This can cause deadlocks. This timeout > issue is hard to reproduce. This update is to add catch any `Throwable` and > log all information needed to understand the root cause. > Also, removed unneeded fragment with the call: > `System.loadLibrary(agentLib);`. > > Testing: > - Executed the test locally: > `serviceability/jvmti/vthread/VThreadTest/VThreadTest.java` > - TBD: Submit: mach5 tiers 1-3 to be completely safe > > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). After catching Throwable in the PRODUCER and CONSUMER runnables, can we fail the test explicitly rather than only logging the exception. If a worker thread exits early after an error, the other thread can still block on the SynchronousQueue, causing join() to hang until the jtreg timeout. Logging alone does makes future failures easier to diagnose. A fail-fast approach (e.g. record the failure in a volatile field and throw from test1() after join(), or rethrow as RuntimeException) would turn this hang into a clear, immediate test failure. ------------- PR Comment: https://git.openjdk.org/jdk/pull/31581#issuecomment-4760858700
