Open pshipton opened 3 hours ago
This is related to https://github.com/eclipse-openj9/openj9/pull/20159 , I looked at most of the failures, most of the test expects a method related to Direct Method Handle in the call stack which would not be there with switch to old reflection, hence this fails.
One concerning failure is in java/lang/Thread/virtual/Reflection.java
which @fengxue-IS is helping taking a look at. Will revert back the commit if soon if we can not find fix / solution soon.
We can't have test failures in the builds, so even if they are expected failures we need to take action to either fix the test or exclude it.
We can't have test failures in the builds, so even if they are expected failures we need to take action to either fix the test or exclude it.
Yes understood and agree, if the fix for the failure with Virtual thread reflection test is simple enough, I will go over and disable the test which are expected to fail - Or else, will revert the commit.
This is related to #20159 , I looked at most of the failures, most of the test expects a method related to Direct Method Handle in the call stack which would not be there with switch to old reflection, hence this fails.
One concerning failure is in
java/lang/Thread/virtual/Reflection.java
which @fengxue-IS is helping taking a look at. Will revert back the commit if soon if we can not find fix / solution soon.
The test hang in this case because the old reflection code path uses jdk/internal/reflect/NativeMethodAccessorImpl.invoke0(Native Method)
to dispatch the call.
invoke0
gets translated into a JNI call to JVM_InvokeMethod
which pins the virtual thread to carrierThread as there are native frames on the stack hence preventing the vthread from unmounting.
There isn't anything broken with the code as this is the expected behaviour for virtual threads. We should consider modifying the test (or excluding this testInvokeStatic6
subtest).
One thing to note is that while the test is an edge case using custom scheduler with single carrier thread. this same issue of pinning can also occur for other use cases where reflection is used.
Thanks a lot @fengxue-IS for the analysis. Given that this behaviour would not be limited to this edge case and issue can occur with other cases trying to use reflection I will open up PR to revert it back once I confirm to document the performance issue.
https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.openjdk_aarch64_mac_OMR_testList_0/125/ jdk_lang java/lang/StackWalker/DumpStackTest.java java/lang/Thread/virtual/Reflection.java java/lang/invoke/callerSensitive/Main.java jdk/internal/vm/TestTranslatedException.java
java/lang/StackWalker/DumpStackTest.java
java/lang/Thread/virtual/Reflection.java
java/lang/invoke/callerSensitive/Main.java
jdk/internal/vm/TestTranslatedException.java
https://github.com/eclipse-openj9/openj9/compare/8393fab...5bf2f17a1db Guessing https://github.com/eclipse-openj9/openj9/pull/20159