Open babsingh opened 8 months ago
@babsingh any updates on this?
I reran the test with OpenJ9 and RI to re-evaluate the issue. I ran the test a few times and neither JDK threw an InterruptedException.
OpenJ9 matches the RI in terms of behaviour. This issue shouldn't block the 0.46 release.
The behaviour between a thread suspended by JVMTI and it receiving an interrupt is not properly defined in the Java doc and JVMTI spec.
For clarification on spec, I will contact the spec SMEs on the RI side.
@babsingh Whats the latest on this?
Whats the latest on this?
@tajila The spec SME didn't respond to our initial email, so I have sent another email to the SME requesting clarification.
In the meantime, OpenJ9 matches the RI in terms of behavior, so this issue shouldn't block the 0.48 release. Moving this issue to the next release.
In JDK22, a new test, GetThreadStateMountedTest, was added to verify the behaviour of interrupting a virtual thread while it is suspended using JVMTI.
The behaviour between a thread suspended by JVMTI and it receiving an interrupt is not properly defined in the Java doc and JVMTI spec.
The goal of this issue is to verify the below [Thread.interrupt](https://download.java.net/java/early_access/jdk22/docs/api/java.base/java/lang/Thread.html#interrupt()) behaviour for a thread suspended by JVMTI:
If a thread is suspended while executing
wait()/wait(timeout)/sleep()
and it receives an interrupt, should the thread throw anInterruptedException
after resuming?After running GetThreadStateMountedTest using the JDK22 RI, it was found that the RI never throws an
InterruptedException
forwaiting(timeout)
andsleeping
. It intermittently throws anInterruptedException
forwaiting
indefinitely (without atimeout
), but most of the time it didn't throw anInterruptedException
even for this case. The test is missing asserts to validateInterruptedException
because the RI doesn't guarantee to throw anInterruptedException
.Based upon the above RI behaviour, throwing an
InterruptedException
is neither expected nor guaranteed.