Skip to content

Support building Proxy Native via GraalVM CE for JDK 25#38682

Open
linghengqian wants to merge 1 commit into
apache:masterfrom
linghengqian:jdk-25
Open

Support building Proxy Native via GraalVM CE for JDK 25#38682
linghengqian wants to merge 1 commit into
apache:masterfrom
linghengqian:jdk-25

Conversation

@linghengqian
Copy link
Copy Markdown
Member

@linghengqian linghengqian commented May 10, 2026

For #29052 .

Changes proposed in this pull request:

[INFO] Running org.apache.shardingsphere.test.natived.proxy.databases.MySQLTest
[INFO] MultiKeyMap stripe configuration: 32 locks for 16 cores
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by io.netty.util.internal.NativeLibraryUtil in an unnamed module (file:/home/lingh/.m2/repository/io/netty/netty-common/4.2.9.Final/netty-common-4.2.9.Final.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.github.benmanes.caffeine.cache.UnsafeAccess (file:/home/lingh/.m2/repository/com/github/ben-manes/caffeine/caffeine/2.9.3/caffeine-2.9.3.jar)
WARNING: Please consider reporting this to the maintainers of class com.github.benmanes.caffeine.cache.UnsafeAccess
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 356.9 s -- in org.apache.shardingsphere.test.natived.proxy.databases.MySQLTest
[INFO] Running org.apache.shardingsphere.test.natived.proxy.databases.PostgresTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 180.0 s -- in org.apache.shardingsphere.test.natived.proxy.databases.PostgresTest
  • Refactor org.apache.shardingsphere.test.natived.commons.util.ProxyTestingServer to use fix from Reset proxy backend executor across repeated ShardingSphereProxy lifecycles #38664 . Also fixes Completely prevent GraalVM Tracing Agent from collecting unreasonable GRM for unit tests related to org.apache.shardingsphere.test.natived.proxy.features.** #33206 .
  • Prevent test/native/native-image-filter/extra-filter.json from grabbing the GraalVM Reachability Metadata of java.lang.**. Compared with GraalVM CE For JDK 24.0.2, GraalVM CE For JDK 25.0.2 has constraints on more JDK own classes. If our grab part of the GRM of java.lang.**, the native image will fail to build.
    • As for why GraalVM CE for JDK 24.0.2 did not trigger this problem, but GraalVM CE for JDK 25.0.2 did, I think only Oracle employees know the answer.🤷‍♂️🤦‍♂️
  • Fixes org.apache.commons:commons-compress dependency conflict with org.apache.shardingsphere:shardingsphere-test-native. This is related to [repo] Dependencies version update ClickHouse/clickhouse-java#2696 .
  • Fixes a bug where org.apache.shardingsphere.test.natived.jdbc.modes.cluster.ZookeeperTest would still make requests to the ZooKeeper server via the ContextManager after the ZooKeeper server was shut down. This was actually an effect of a recent change introduced in the ShardingSphere master branch, which now attempts to access the ZooKeeper server when the ContextManager is shut down.
  • Apply the changes from [GR-72012] Available memory should never exceed total memory. oracle/graal#12720 to remove "-DjvmArgs=-XX:MaxRAMPercentage=85.0" from the CI.
  • Previously, the test class org.apache.shardingsphere.test.natived.proxy.databases.** passed the absolute file system path to org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader. org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader first resolved the path using the classpath, causing the GraalVM native image to encounter abnormal paths during resource matching. Now, org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader first checks the file system path and then falls back to the classpath, avoiding passing absolute path errors to java.lang.Class#getResource(java.lang.String). This is the root cause change that fixed the CompressedGlobTrie in the GraalVM native image.
    • As for why GraalVM CE for JDK 24.0.2 did not trigger this problem, but GraalVM CE for JDK 25.0.2 did, I think only Oracle employees know the answer.🤷‍♂️🤦‍♂️

Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.
  • I have updated the Release Notes of the current development version. For more details, see Update Release Note

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant