lizhimins commented on PR #10638: URL: https://github.com/apache/rocketmq/pull/10638#issuecomment-7155789923
Thanks for the fix — the approach is right, and I verified the mechanism locally against the actual dependency versions on `develop` (jraft-core 1.3.14 -> sofa-hessian 3.3.6) on JDK 21: - Without the flag: `new SerializerFactory()` fails with exactly the stack trace from #10612 (`JavaDeserializer.getFieldMap` -> `StackTraceElementDeserializer` -> `SerializerFactory.<clinit>`). - With `--add-opens java.base/java.lang=ALL-UNNAMED`: initialization succeeds. - JDK 8 rejects the flag (`Unrecognized option: --add-opens`), confirming the JDK 9+ branch guard is required. The placement is correct, and the scope checks out: `com.caucho` is referenced only from `ReplicasInfoManager`, and since `RaftReplicasInfoManager extends ReplicasInfoManager`, both the DLedger- and JRaft-based controllers are covered. The broker (`runbroker.sh`) doesn't touch Hessian, so no change is needed there. A few things to address before merging: 1. **The dependency provenance in the script comment (and PR body) is wrong.** Hessian is not pulled in via DLedger — the `dledger` 0.3.3.4 pom has no hessian dependency, and its jar contains no `com/caucho` references at all. The actual chain is `controller -> jraft-core (sofa-jraft) -> com.alipay.sofa:hessian`. Since this provenance is baked into a permanent script comment, please correct it so future readers don't chase the wrong dependency. 2. **Comment length / charset nit.** Seven lines of comment for a one-line flag is a bit heavy — 2-3 lines keeping the issue references would be enough. Also please keep the comment ASCII (the current em dash is non-ASCII). 3. **Windows gap.** `runserver.cmd` already has a JDK 17+ branch, so adding the equivalent `set "JAVA_OPT=%JAVA_OPT% --add-opens java.base/java.lang=ALL-UNNAMED"` there is equally low-risk. Could you include it in this PR, or open a follow-up issue so it doesn't get lost? 4. **Verification / CI.** CI hasn't run yet (first-time-contributor gate), and the integration-test matrix is JDK 8 only, so it wouldn't catch this anyway. A maintainer will need to approve the workflow runs; ideally someone could also smoke-test an actual `mqcontroller` (or controller-in-namesrv) startup on JDK 17, since verification so far is at the reflective-access level rather than a full startup. With the comment provenance fixed, this looks good to me — minimal, correctly guarded, and consistent with the workaround endorsed in #10170. -- 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]
