azagrebin opened a new pull request #12270:
URL: https://github.com/apache/flink/pull/12270


   ## What is the purpose of the change
   
   #11109 did not export `jdk.internal.misc` package used by reflection for GC 
cleaners of managed memory. Our PR CI does not run Java 11 tests atm. The 
package has to be exported by a JVM runtime arg: `--add-opens 
java.base/jdk.internal.misc=ALL-UNNAMED;`
   
   If this arg is set for Java 8, it fails the JVM process. Therefore, the fix 
is complicated as we have to do it also for e.g. Yarn CLI where client and 
cluster may run different Java versions.
   
   This PR suggests a quicker fix. We call directly the private method (has to 
be made accessible via reflection):
   - java.lang.ref.Reference.tryHandlePending(false) // for Java 8
   - java.lang.ref.Reference.waitForReferenceProcessing() // for Java 11
   
   Unfortunately, this leads to the annoying warning for Java 11 about Illegal 
reflective access.
   We can do the quick fix and think how to tackle the warning in a follow-up.
   
   ## Verifying this change
   
   Existing unit tests but also running them and e2e tests with Java 11.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to