CalvinKirs opened a new pull request, #68465:
URL: https://github.com/apache/doris/pull/68465

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: None
   
   Problem Summary: FE can only be built and started with JDK 17. This makes FE 
build and start with JDK 21. Since the compile target becomes 21, FE can no 
longer be built with JDK 17; env.sh and start_fe.sh still accept 17 for other 
components and for running existing builds.
   
   - fe/pom.xml, fe/fe-core/pom.xml: compile target 17 -> 21 (including the 
hard-coded `<release>` of fe-core), lombok 1.18.24 -> 1.18.34 because older 
lombok cannot run on JDK 21.
   - env.sh: accept JDK 17 or 21. Previously a JDK 21 JAVA_HOME made env.sh 
exit 1, which made the fe-common gensrc `make` step get skipped while the maven 
build still reported success.
   - bin/start_fe.sh: accept JDK 21, use JAVA_OPTS_FOR_JDK_21 if set and 
otherwise fall back to JAVA_OPTS_FOR_JDK_17. On JDK 21 also add 
`--add-opens=java.base/jdk.internal.vm=ALL-UNNAMED`: Gson builds 
deserialization adapters for every field of a persisted class, including fields 
without @SerializedName such as `Database.rwLock`, whose type graph reaches 
`java.lang.Thread`. On JDK 21 Thread references `jdk.internal.vm.Continuation`, 
so without the opens FE fails writing the first editlog (CreateDbInfo) with 
InaccessibleObjectException.
   
   Not covered: FE unit tests on JDK 21, BE scripts, and the 
JAVA_OPTS_FOR_JDK_17 entries in the conf files, docker and regression pipeline 
configs.
   
   ### Release note
   
   FE can be built and started with JDK 21 in addition to JDK 17.
   
   ### Check List (For Author)
   
   - Test: Manual test
       - `mvn clean package -DskipTests` and `./build.sh --fe` succeed with JDK 
21 (class major version 65).
       - Started a single FE with JDK 21: it becomes master and alive, and 
creating a database works. No BE was started.
       - FE unit tests were not run.
   - Behavior changed: Yes (JDK 21 is now accepted by env.sh and start_fe.sh; 
FE bytecode target is now Java 21, so FE can no longer be built with JDK 17)
   - Does this need documentation: No
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to