RFR: 8369227: Virtual thread stuck in PARKED state

Alan Bateman alanb at openjdk.org
Tue Jan 6 06:46:54 UTC 2026


A regression since we changed the VirtualThread implementation to use use FJP delayed task handling (JDK-8351927) in JDK 25.

If a virtual thread does a timed-park, followed immediately by an untimed-park, while racing with both an async unpark and the execution of cancelled timeout-task, then it is possible for the virtual thread to get stuck in the parked state. More specifically, it is possible for stars to align to create the scenario where parkTimeoutExpired makes available the parking permit but it doesn't continue the thread because it has moved on to an untimed-park.  A small oversight that crept in when the timeout support was migrated to use the new delay scheduler.

Testing: tier1-5. New stress tests added, and existing stress test TimedWaitALot updated.

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

Commit messages:
 - Test pinned case too
 - Merge branch 'master' into JDK-8369227
 - Merge branch 'master' into JDK-8369227
 - Merge branch 'master' into JDK-8369227
 - Initial commit

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

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


More information about the core-libs-dev mailing list