davidzollo opened a new pull request, #12702:
URL: https://github.com/apache/seatunnel/pull/12702

   ### Purpose of this pull request
   
   Follow-up to #11545, from a review comment there: 
https://github.com/apache/seatunnel/pull/11545#discussion_r4215295800
   
   #11545 made `seatunnel.sh` and `seatunnel-cluster.sh` append the mandatory 
JDK 9+ `--add-opens`/`--add-exports` flags themselves and fail fast on a JVM 
older than Java 11. The Windows launchers `seatunnel.cmd` and 
`seatunnel-cluster.cmd` were not covered: they take those flags only from 
`config\jvm_*_options` or `JvmOption`. A Windows user who upgrades to Java 17 
and keeps an existing `jvm_*_options` therefore starts without the flags.
   
   Reported consequence (from the review): Doris and StarRocks source reads go 
through the shared `ArrowToSeatunnelRowReader`; on Java 17 `loadNextBatch()` 
fails because `java.nio.Buffer.address` is inaccessible, and 
`--add-opens=java.base/java.nio=ALL-UNNAMED` alone makes the same read pass.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Windows launchers now behave like the shell launchers: a Java 11+ JVM gets 
the mandatory module flags even with an old `config\jvm_*_options`, and a JVM 
older than 11 exits with `SeaTunnel requires Java 11 or newer, but Java N was 
detected.` instead of the raw `Unrecognized option` error. No option, config 
key or API changes. 
`docs/{en,zh}/introduction/concepts/incompatible-changes.md` (item 5 of the 
Runtime Requirements entry) now names the `.cmd` launchers too.
   
   ### How was this patch tested?
   
   **Not verified on Windows.** No Windows environment was available, so the 
batch logic was checked by reading it only, and this PR does not claim a 
Windows end-to-end run. The GitHub CI matrix does not execute these launchers, 
so a green run proves nothing about them either. Please run `bin\seatunnel.cmd` 
and `bin\seatunnel-cluster.cmd` on Windows with Java 8, 11 and 17 before 
relying on it.
   
   What the change does, in both files, after the config and `JvmOption` 
options are assembled:
   - Reads `java -version`, derives the major version (`1.8` becomes 8), and 
exits with an error if it is below 11. If the version cannot be parsed the 
check is skipped instead of blocking startup.
   - Loops over the six flags (`java.base/java.lang`, `java.net`, `java.nio`, 
`java.util`, `sun.nio.ch` opens and the `java.security.jgss/sun.security.krb5` 
export) and appends each one unless `findstr` finds it already in `JAVA_OPTS`.
   
   Files use CRLF in the working tree (`.gitattributes` `eol=crlf`) and are 
stored as LF; the diff is 38 added lines per launcher. No Java or XML file 
changed, so there is nothing for Spotless to format.
   
   ### Check list
   
   * [x] Documentation updated (en and zh `incompatible-changes.md`)
   * [ ] Tested on Windows (not done, see above)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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

Reply via email to