You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "MartijnVisser (via GitHub)" <gi...@apache.org> on 2025/01/05 11:15:42 UTC
[PR] [WIP][FLINK-36181] Use Java 17 by default [flink]
MartijnVisser opened a new pull request, #25898:
URL: https://github.com/apache/flink/pull/25898
## What is the purpose of the change
This PR is a Work In Progress, and will change Flink to use Java 17 by default.
## Brief change log
## Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): don't know
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? docs
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1905181258
##########
.github/workflows/nightly.yml:
##########
@@ -39,23 +39,12 @@ jobs:
s3_bucket: ${{ secrets.IT_CASE_S3_BUCKET }}
s3_access_key: ${{ secrets.IT_CASE_S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.IT_CASE_S3_SECRET_KEY }}
- java17:
- name: "Java 17"
- uses: ./.github/workflows/template.flink-ci.yml
- with:
- workflow-caller-id: java17
- environment: 'PROFILE="-Dinclude_hadoop_aws -Djdk11 -Djdk17 -Pjava17-target"'
- jdk_version: 17
- secrets:
- s3_bucket: ${{ secrets.IT_CASE_S3_BUCKET }}
- s3_access_key: ${{ secrets.IT_CASE_S3_ACCESS_KEY }}
- s3_secret_key: ${{ secrets.IT_CASE_S3_SECRET_KEY }}
Review Comment:
I believe this is the dedicated job to test Java 17, which would be redundant given that we use 17 by default already
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP][FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #25898:
URL: https://github.com/apache/flink/pull/25898#issuecomment-2571616830
@MartijnVisser I think you need to rebase to the latest master
the failure seems to be related to the bug in master fixed within https://github.com/apache/flink/pull/25895
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1907845089
##########
pom.xml:
##########
@@ -1418,7 +1426,7 @@ under the License.
<!-- versions for certain build tools are enforced to match the CI setup -->
<!-- the rules below should stay in sync with Flink Release wiki documentation and the CI scripts -->
<requireJavaVersion>
- <version>[11.0.0,11.1.0)</version>
+ <version>[17.*)</version>
Review Comment:
```suggestion
<version>[${target.java.version}.*)</version>
```
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1906152062
##########
pom.xml:
##########
@@ -124,7 +124,7 @@ under the License.
<flink.shaded.jackson.version>2.15.3</flink.shaded.jackson.version>
<flink.shaded.jsonpath.version>2.7.0</flink.shaded.jsonpath.version>
<flink.markBundledAsOptional>true</flink.markBundledAsOptional>
- <target.java.version>11</target.java.version>
+ <target.java.version>17</target.java.version>
Review Comment:
```suggestion
<source.java.version>11</source.java.version>
<target.java.version>17</target.java.version>
```
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1906139229
##########
pom.xml:
##########
@@ -124,7 +124,7 @@ under the License.
<flink.shaded.jackson.version>2.15.3</flink.shaded.jackson.version>
<flink.shaded.jsonpath.version>2.7.0</flink.shaded.jsonpath.version>
<flink.markBundledAsOptional>true</flink.markBundledAsOptional>
- <target.java.version>11</target.java.version>
+ <target.java.version>17</target.java.version>
Review Comment:
no it is different
I tested locally with this PR branch
1. add any java 12-17 feature, e.g. any constant like
```java
final String t =
"""
text block
""";
```
this text block feature came with java 14
2. build it with `./mvnw clean install -DskipTests -Dscala-2.12 -Pfast -Pskip-webui-build -U -T4`
by default there is java 17 so everything is ok
3. now do same with java11 (also put it into JAVA_HOME) like
`./mvnw clean install -DskipTests -Dscala-2.12 -Pfast -Pskip-webui-build -U -T4 -Pjava11 -Pjava11-target`
and it fails like
```
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] flink/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/OrcSplitReaderUtil.java:[122,19] unclosed string literal
[ERROR] flink/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/OrcSplitReaderUtil.java:[123,5] not a statement
[ERROR] flink/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/OrcSplitReaderUtil.java:[123,11] ';' expected
[ERROR] flink/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/OrcSplitReaderUtil.java:[124,7] unclosed string literal
[INFO] 4 errors
```
since I put constant in `OrcSplitReaderUtil` it complains about this class
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1907842224
##########
README.md:
##########
@@ -104,12 +104,12 @@ Prerequisites for building Flink:
* Unix-like environment (we use Linux, Mac OS X, Cygwin, WSL)
* Git
* Maven (we require version 3.8.6)
-* Java 11
+* Java 17 (by default. You can also use 21 or 11)
```
git clone https://github.com/apache/flink.git
cd flink
-./mvnw clean package -DskipTests # this will take up to 10 minutes
+./mvnw clean package -DskipTests -Djdk17 -Pjava17-target # this will take up to 10 minutes
Review Comment:
nit: I think we could add similar for jdk11 since these flags are not trivial
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1905102798
##########
.github/workflows/nightly.yml:
##########
@@ -39,23 +39,12 @@ jobs:
s3_bucket: ${{ secrets.IT_CASE_S3_BUCKET }}
s3_access_key: ${{ secrets.IT_CASE_S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.IT_CASE_S3_SECRET_KEY }}
- java17:
- name: "Java 17"
- uses: ./.github/workflows/template.flink-ci.yml
- with:
- workflow-caller-id: java17
- environment: 'PROFILE="-Dinclude_hadoop_aws -Djdk11 -Djdk17 -Pjava17-target"'
- jdk_version: 17
- secrets:
- s3_bucket: ${{ secrets.IT_CASE_S3_BUCKET }}
- s3_access_key: ${{ secrets.IT_CASE_S3_ACCESS_KEY }}
- s3_secret_key: ${{ secrets.IT_CASE_S3_SECRET_KEY }}
Review Comment:
Can you elaborate why we remove this?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1907847458
##########
pom.xml:
##########
@@ -1064,15 +1063,29 @@ under the License.
</build>
</profile>
+ <profile>
+ <id>java11-target</id>
Review Comment:
looks like I missed one thing for local testing (with jdk 11)
```
./mvnw clean install -DskipTests -Dscala-2.12 -Pfast -Pskip-webui-build -U -T4 -Pjava11 -Pjava11-target
```
this line was working since it has `-Pfast` which turns off enforcer plugin...
Without that it still fails.
Need to make java version in enforcer plugin configurable to make it working just as
```
./mvnw clean install -Pjava11-target
```
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #25898:
URL: https://github.com/apache/flink/pull/25898#issuecomment-2589981730
@flinkbot run azure
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser merged PR #25898:
URL: https://github.com/apache/flink/pull/25898
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1907848187
##########
pom.xml:
##########
@@ -1418,7 +1426,7 @@ under the License.
<!-- versions for certain build tools are enforced to match the CI setup -->
<!-- the rules below should stay in sync with Flink Release wiki documentation and the CI scripts -->
<requireJavaVersion>
- <version>[11.0.0,11.1.0)</version>
+ <version>[17.*)</version>
Review Comment:
same reason about configurable java version for enforcer
as mentioned at
https://github.com/apache/flink/pull/25898/files#r1907847458
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #25898:
URL: https://github.com/apache/flink/pull/25898#issuecomment-2586593431
Last minute comment
I noticed we have also scala version mentioned at https://github.com/apache/flink/blob/105720fc5cb6a2353f049dc3542267ad2da326d3/flink-rpc/flink-rpc-akka/pom.xml#L42
how about sync it with the one in main pom?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1906153824
##########
pom.xml:
##########
@@ -124,7 +124,7 @@ under the License.
<flink.shaded.jackson.version>2.15.3</flink.shaded.jackson.version>
<flink.shaded.jsonpath.version>2.7.0</flink.shaded.jsonpath.version>
<flink.markBundledAsOptional>true</flink.markBundledAsOptional>
- <target.java.version>11</target.java.version>
+ <target.java.version>17</target.java.version>
Review Comment:
Also played and created a branch where this issue is solved (just 3 lines)
https://github.com/snuyanzin/flink/commit/ba570320efd5edd04acdd6d8a137fc5e19c794f9
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP][FLINK-36181] Use Java 17 by default [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #25898:
URL: https://github.com/apache/flink/pull/25898#issuecomment-2571590347
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "a0684fd6aa67d81c3e117622b82495fe6c08fe41",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "a0684fd6aa67d81c3e117622b82495fe6c08fe41",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* a0684fd6aa67d81c3e117622b82495fe6c08fe41 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1907847458
##########
pom.xml:
##########
@@ -1064,15 +1063,29 @@ under the License.
</build>
</profile>
+ <profile>
+ <id>java11-target</id>
Review Comment:
looks like I missed one thing for local testing (with jdk 11)
```
./mvnw clean install -DskipTests -Dscala-2.12 -Pfast -Pskip-webui-build -U -T4 -Pjava11 -Pjava11-target
```
this line was working since it has `-Dfast` which turns off enforcer plugin...
Without that it still fails.
Need to make java version in enforcer plugin configurable to make it working just as
```
./mvnw clean install -Pjava11-target
```
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1905107370
##########
pom.xml:
##########
@@ -124,7 +124,7 @@ under the License.
<flink.shaded.jackson.version>2.15.3</flink.shaded.jackson.version>
<flink.shaded.jsonpath.version>2.7.0</flink.shaded.jsonpath.version>
<flink.markBundledAsOptional>true</flink.markBundledAsOptional>
- <target.java.version>11</target.java.version>
+ <target.java.version>17</target.java.version>
Review Comment:
if we make 17 as default for ci
can we protect ourselves from the case when someone submits a PR with jdk 12-17 features and it passes PR ci, however after being merged fails during nightly where we have jdk11?
I vaguely guess it is possible with setting `maven-compiler.source`
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1906152062
##########
pom.xml:
##########
@@ -124,7 +124,7 @@ under the License.
<flink.shaded.jackson.version>2.15.3</flink.shaded.jackson.version>
<flink.shaded.jsonpath.version>2.7.0</flink.shaded.jsonpath.version>
<flink.markBundledAsOptional>true</flink.markBundledAsOptional>
- <target.java.version>11</target.java.version>
+ <target.java.version>17</target.java.version>
Review Comment:
```suggestion
<source.java.version>11</source.java.version>
<target.java.version>17</target.java.version>
```
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1906000962
##########
pom.xml:
##########
@@ -124,7 +124,7 @@ under the License.
<flink.shaded.jackson.version>2.15.3</flink.shaded.jackson.version>
<flink.shaded.jsonpath.version>2.7.0</flink.shaded.jsonpath.version>
<flink.markBundledAsOptional>true</flink.markBundledAsOptional>
- <target.java.version>11</target.java.version>
+ <target.java.version>17</target.java.version>
Review Comment:
I've added `<release` as an option and set that to Java 11, I think that's what you're referring to?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1907847458
##########
pom.xml:
##########
@@ -1064,15 +1063,29 @@ under the License.
</build>
</profile>
+ <profile>
+ <id>java11-target</id>
Review Comment:
looks like I missed one thing for local testing
```
./mvnw clean install -DskipTests -Dscala-2.12 -Pfast -Pskip-webui-build -U -T4 -Pjava11 -Pjava11-target
```
this line was working since it has `-Dfast` which turns off enforcer plugin...
Without that it still fails.
Need to make java version in enforcer plugin configurable to make it working just as
```
./mvnw clean install -Pjava11-target
```
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36181] Use Java 17 by default [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #25898:
URL: https://github.com/apache/flink/pull/25898#discussion_r1907844490
##########
pom.xml:
##########
@@ -1064,15 +1063,29 @@ under the License.
</build>
</profile>
+ <profile>
+ <id>java11-target</id>
Review Comment:
```suggestion
<id>java11-target</id>
<properties>
<target.java.version>11</target.java.version>
</properties>
```
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org