The tests `SuspendResume1`, `SuspendResume2` and `SuspendResumeAll` are 
intermittently failed with a timeout (deadlock). The tests run with 
`-Djdk.virtualThreadScheduler.maxPoolSize=1` so there is only one carrier. The 
short sleep in `TestedThread.run` isn't sufficient to make progress. This will 
happen if tasks pushed by the delayed scheduler are executing before the tasks 
for the newly started virtual thread. FJP won't search other submission queues 
until the queue it keeps going back to is empty or there is contention. These 
deadlocks can be made better reproducible if the sleep in `TestedThread.run` is 
made minimal (1 millisecond).
The fix is to increase the sleep to 50 milliseconds and also to decrease the 
busy part of the busy loop.

Testing:
- Mach5 test runs of the fixed tests

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

Commit messages:
 - SuspendResume1.java and SuspendResume2.java timeout after JDK-8319447

Changes: https://git.openjdk.org/jdk/pull/25194/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25194&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8353496
  Stats: 12 lines in 3 files changed: 0 ins; 0 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/25194.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25194/head:pull/25194

PR: https://git.openjdk.org/jdk/pull/25194

Reply via email to