Skip to content

Commit 17dda61

Browse files
authored
[FLINK-38903] Update flink-shaded to 21.0
1 parent 2426faf commit 17dda61

File tree

8 files changed

+114
-36
lines changed

8 files changed

+114
-36
lines changed

docs/layouts/shortcodes/generated/security_configuration.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
</tr>
245245
<tr>
246246
<td><h5>security.ssl.verify-hostname</h5></td>
247-
<td style="word-wrap: break-word;">true</td>
247+
<td style="word-wrap: break-word;">false</td>
248248
<td>Boolean</td>
249249
<td>Flag to enable peer’s hostname verification during ssl handshake.</td>
250250
</tr>

docs/layouts/shortcodes/generated/security_ssl_section.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
</tr>
137137
<tr>
138138
<td><h5>security.ssl.verify-hostname</h5></td>
139-
<td style="word-wrap: break-word;">true</td>
139+
<td style="word-wrap: break-word;">false</td>
140140
<td>Boolean</td>
141141
<td>Flag to enable peer’s hostname verification during ssl handshake.</td>
142142
</tr>

flink-core/src/main/java/org/apache/flink/configuration/SecurityOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ public static Configuration forProvider(Configuration configuration, String prov
519519
public static final ConfigOption<Boolean> SSL_VERIFY_HOSTNAME =
520520
key("security.ssl.verify-hostname")
521521
.booleanType()
522-
.defaultValue(true)
522+
.defaultValue(false)
523523
.withDescription(
524524
"Flag to enable peer’s hostname verification during ssl handshake.");
525525

flink-runtime-web/src/test/resources/rest_api_v1.snapshot

Lines changed: 68 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@
15521552
"properties" : {
15531553
"checkpointed_size" : {
15541554
"type" : "object",
1555-
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto",
1555+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto",
15561556
"properties" : {
15571557
"min" : {
15581558
"type" : "integer"
@@ -1582,23 +1582,23 @@
15821582
},
15831583
"state_size" : {
15841584
"type" : "object",
1585-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
1585+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
15861586
},
15871587
"end_to_end_duration" : {
15881588
"type" : "object",
1589-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
1589+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
15901590
},
15911591
"alignment_buffered" : {
15921592
"type" : "object",
1593-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
1593+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
15941594
},
15951595
"processed_data" : {
15961596
"type" : "object",
1597-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
1597+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
15981598
},
15991599
"persisted_data" : {
16001600
"type" : "object",
1601-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
1601+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
16021602
}
16031603
}
16041604
},
@@ -2155,7 +2155,7 @@
21552155
"properties" : {
21562156
"checkpointed_size" : {
21572157
"type" : "object",
2158-
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto",
2158+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto",
21592159
"properties" : {
21602160
"min" : {
21612161
"type" : "integer"
@@ -2185,23 +2185,23 @@
21852185
},
21862186
"state_size" : {
21872187
"type" : "object",
2188-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2188+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
21892189
},
21902190
"end_to_end_duration" : {
21912191
"type" : "object",
2192-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2192+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
21932193
},
21942194
"checkpoint_duration" : {
21952195
"type" : "object",
21962196
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatisticsWithSubtaskDetails:CheckpointDuration",
21972197
"properties" : {
21982198
"sync" : {
21992199
"type" : "object",
2200-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2200+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
22012201
},
22022202
"async" : {
22032203
"type" : "object",
2204-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2204+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
22052205
}
22062206
}
22072207
},
@@ -2211,25 +2211,25 @@
22112211
"properties" : {
22122212
"buffered" : {
22132213
"type" : "object",
2214-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2214+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
22152215
},
22162216
"processed" : {
22172217
"type" : "object",
2218-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2218+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
22192219
},
22202220
"persisted" : {
22212221
"type" : "object",
2222-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2222+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
22232223
},
22242224
"duration" : {
22252225
"type" : "object",
2226-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2226+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
22272227
}
22282228
}
22292229
},
22302230
"start_delay" : {
22312231
"type" : "object",
2232-
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util.stats:StatsSummaryDto"
2232+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:util:stats:StatsSummaryDto"
22332233
}
22342234
}
22352235
},
@@ -2820,7 +2820,30 @@
28202820
},
28212821
"response" : {
28222822
"type" : "object",
2823-
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:JobResourceRequirementsBody"
2823+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:JobResourceRequirementsBody",
2824+
"properties" : {
2825+
"jobVertexResourceRequirements" : {
2826+
"type" : "object",
2827+
"additionalProperties" : {
2828+
"type" : "object",
2829+
"id" : "urn:jsonschema:org:apache:flink:runtime:jobgraph:JobVertexResourceRequirements",
2830+
"properties" : {
2831+
"parallelism" : {
2832+
"type" : "object",
2833+
"id" : "urn:jsonschema:org:apache:flink:runtime:jobgraph:JobVertexResourceRequirements:Parallelism",
2834+
"properties" : {
2835+
"lowerBound" : {
2836+
"type" : "integer"
2837+
},
2838+
"upperBound" : {
2839+
"type" : "integer"
2840+
}
2841+
}
2842+
}
2843+
}
2844+
}
2845+
}
2846+
}
28242847
}
28252848
}, {
28262849
"url" : "/jobs/:jobid/resource-requirements",
@@ -2837,7 +2860,30 @@
28372860
},
28382861
"request" : {
28392862
"type" : "object",
2840-
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:JobResourceRequirementsBody"
2863+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:JobResourceRequirementsBody",
2864+
"properties" : {
2865+
"jobVertexResourceRequirements" : {
2866+
"type" : "object",
2867+
"additionalProperties" : {
2868+
"type" : "object",
2869+
"id" : "urn:jsonschema:org:apache:flink:runtime:jobgraph:JobVertexResourceRequirements",
2870+
"properties" : {
2871+
"parallelism" : {
2872+
"type" : "object",
2873+
"id" : "urn:jsonschema:org:apache:flink:runtime:jobgraph:JobVertexResourceRequirements:Parallelism",
2874+
"properties" : {
2875+
"lowerBound" : {
2876+
"type" : "integer"
2877+
},
2878+
"upperBound" : {
2879+
"type" : "integer"
2880+
}
2881+
}
2882+
}
2883+
}
2884+
}
2885+
}
2886+
}
28412887
},
28422888
"response" : {
28432889
"type" : "object",
@@ -4441,12 +4487,12 @@
44414487
"jobId" : {
44424488
"type" : "any"
44434489
},
4444-
"assignedTasks" : {
4445-
"type" : "integer"
4446-
},
44474490
"resource" : {
44484491
"type" : "object",
44494492
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:ResourceProfileInfo"
4493+
},
4494+
"assignedTasks" : {
4495+
"type" : "integer"
44504496
}
44514497
}
44524498
}
@@ -4634,4 +4680,4 @@
46344680
}
46354681
}
46364682
} ]
4637-
}
4683+
}

flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ private static SslContext createInternalNettySSLContext(
367367
sslContextBuilder = SslContextBuilder.forServer(kmf);
368368
}
369369

370+
setHostnameVerification(sslContextBuilder, config, clientMode);
371+
370372
Optional<TrustManagerFactory> tmf = getTrustManagerFactory(config, true);
371373
tmf.map(sslContextBuilder::trustManager);
372374

@@ -433,6 +435,8 @@ public static SslContext createRestNettySSLContext(
433435
sslContextBuilder = SslContextBuilder.forServer(kmf);
434436
}
435437

438+
setHostnameVerification(sslContextBuilder, config, clientMode);
439+
436440
if (clientMode || clientAuth != ClientAuth.NONE) {
437441
Optional<TrustManagerFactory> tmf = getTrustManagerFactory(config, false);
438442
tmf.map(
@@ -453,6 +457,18 @@ public static SslContext createRestNettySSLContext(
453457
// Utilities
454458
// ------------------------------------------------------------------------
455459

460+
/**
461+
* Set hostname verification. By default, Netty will enable hostname verification since 4.2.x
462+
* for client-mode connections.
463+
*/
464+
private static void setHostnameVerification(
465+
SslContextBuilder sslContextBuilder, Configuration config, boolean clientMode) {
466+
if (clientMode) {
467+
sslContextBuilder.endpointIdentificationAlgorithm(
468+
config.get(SecurityOptions.SSL_VERIFY_HOSTNAME) ? "HTTPS" : null);
469+
}
470+
}
471+
456472
private static String getAndCheckOption(
457473
Configuration config,
458474
ConfigOption<String> primaryOption,

flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyConnectionManagerTest.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
/** Simple netty connection manager test. */
3737
class NettyConnectionManagerTest {
3838

39+
private static final String EVENT_EXECUTOR_GROUP_FIELD_CHILDREN = "children";
40+
3941
/**
4042
* Tests that the number of arenas and number of threads of the client and server are set to the
4143
* same number, that is the number of configured task slots.
@@ -68,7 +70,7 @@ void testMatchingNumberOfArenasAndThreadsAsDefault() throws Exception {
6870
Bootstrap boostrap = connectionManager.getClient().getBootstrap();
6971
EventLoopGroup group = boostrap.config().group();
7072

71-
Field f = group.getClass().getSuperclass().getSuperclass().getDeclaredField("children");
73+
Field f = getInheritedField(group.getClass());
7274
f.setAccessible(true);
7375
Object[] eventExecutors = (Object[]) f.get(group);
7476

@@ -80,7 +82,7 @@ void testMatchingNumberOfArenasAndThreadsAsDefault() throws Exception {
8082
ServerBootstrap bootstrap = connectionManager.getServer().getBootstrap();
8183
EventLoopGroup group = bootstrap.config().group();
8284

83-
Field f = group.getClass().getSuperclass().getSuperclass().getDeclaredField("children");
85+
Field f = getInheritedField(group.getClass());
8486
f.setAccessible(true);
8587
Object[] eventExecutors = (Object[]) f.get(group);
8688

@@ -92,7 +94,7 @@ void testMatchingNumberOfArenasAndThreadsAsDefault() throws Exception {
9294
ServerBootstrap bootstrap = connectionManager.getServer().getBootstrap();
9395
EventLoopGroup group = bootstrap.childGroup();
9496

95-
Field f = group.getClass().getSuperclass().getSuperclass().getDeclaredField("children");
97+
Field f = getInheritedField(group.getClass());
9698
f.setAccessible(true);
9799
Object[] eventExecutors = (Object[]) f.get(group);
98100

@@ -104,4 +106,18 @@ private NettyConnectionManager createNettyConnectionManager(NettyConfig config)
104106
return new NettyConnectionManager(
105107
new ResultPartitionManager(), new TaskEventDispatcher(), config, true);
106108
}
109+
110+
private static Field getInheritedField(Class<?> clazz) {
111+
while (clazz != null) {
112+
try {
113+
Field field = clazz.getDeclaredField(EVENT_EXECUTOR_GROUP_FIELD_CHILDREN);
114+
field.setAccessible(true);
115+
return field;
116+
} catch (NoSuchFieldException e) {
117+
clazz = clazz.getSuperclass();
118+
}
119+
}
120+
throw new IllegalArgumentException(
121+
"Field " + EVENT_EXECUTOR_GROUP_FIELD_CHILDREN + " not found in hierarchy");
122+
}
107123
}

flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/ExecNodeBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public abstract class ExecNodeBase<T> implements ExecNode<T> {
9292
* Retrieves the default context from the {@link ExecNodeMetadata} annotation to be serialized
9393
* into the JSON plan.
9494
*/
95-
@JsonProperty(value = FIELD_NAME_TYPE, access = JsonProperty.Access.READ_ONLY, index = 1)
95+
@JsonProperty(value = FIELD_NAME_TYPE, index = 1)
9696
protected final ExecNodeContext getContextFromAnnotation() {
9797
return isCompiled ? context : ExecNodeContext.newContext(this.getClass()).withId(getId());
9898
}

pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ under the License.
127127
<flink.forkCountUnitTest>4</flink.forkCountUnitTest>
128128
<flink.reuseForks>true</flink.reuseForks>
129129
<flink.surefire.baseArgLine>-XX:+UseG1GC -Xms256m -XX:+IgnoreUnrecognizedVMOptions ${surefire.module.config}</flink.surefire.baseArgLine>
130-
<flink.shaded.version>20.0</flink.shaded.version>
131-
<flink.shaded.jackson.version>2.18.2</flink.shaded.jackson.version>
132-
<flink.shaded.jsonpath.version>2.9.0</flink.shaded.jsonpath.version>
130+
<flink.shaded.version>21.0</flink.shaded.version>
131+
<flink.shaded.jackson.version>2.20.1</flink.shaded.jackson.version>
132+
<flink.shaded.jsonpath.version>2.10.0</flink.shaded.jsonpath.version>
133133
<flink.markBundledAsOptional>true</flink.markBundledAsOptional>
134134
<source.java.version>11</source.java.version>
135135
<target.java.version>17</target.java.version>
@@ -355,13 +355,13 @@ under the License.
355355
<dependency>
356356
<groupId>org.apache.flink</groupId>
357357
<artifactId>flink-shaded-asm-9</artifactId>
358-
<version>9.6-${flink.shaded.version}</version>
358+
<version>9.9.1-${flink.shaded.version}</version>
359359
</dependency>
360360

361361
<dependency>
362362
<groupId>org.apache.flink</groupId>
363363
<artifactId>flink-shaded-guava</artifactId>
364-
<version>33.4.0-jre-${flink.shaded.version}</version>
364+
<version>33.5.0-jre-${flink.shaded.version}</version>
365365
</dependency>
366366

367367
<dependency>
@@ -379,13 +379,13 @@ under the License.
379379
<dependency>
380380
<groupId>org.apache.flink</groupId>
381381
<artifactId>flink-shaded-netty</artifactId>
382-
<version>4.1.100.Final-${flink.shaded.version}</version>
382+
<version>4.2.6.Final-${flink.shaded.version}</version>
383383
</dependency>
384384

385385
<dependency>
386386
<groupId>org.apache.flink</groupId>
387387
<artifactId>flink-shaded-netty-tcnative-dynamic</artifactId>
388-
<version>2.0.62.Final-${flink.shaded.version}</version>
388+
<version>2.0.74.Final-${flink.shaded.version}</version>
389389
<scope>test</scope>
390390
</dependency>
391391

0 commit comments

Comments
 (0)