snuyanzin commented on code in PR #28995:
URL: https://github.com/apache/flink/pull/28995#discussion_r4303809950


##########
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/utils/KubernetesUtils.java:
##########
@@ -694,5 +702,31 @@ public static String getNamespacedServiceName(Service 
service) {
         return service.getMetadata().getName() + "." + 
service.getMetadata().getNamespace();
     }
 
+    /**
+     * Fails fast if the {@code java.net.http} WebSocket client of the given 
JDK mishandles URLs
+     * with percent-encoded query parameters (JDK-8245245). Flink's Kubernetes 
watches carry
+     * percent-encoded label and field selectors, so on such JDKs the pod 
watches and the Kubernetes
+     * HA leader election would break at runtime.
+     *
+     * @param version the runtime version to check, normally {@link 
Runtime#version()}
+     * @throws IllegalStateException if the JDK does not contain the fix
+     */
+    public static void checkJdkHttpClientSupport(Runtime.Version version) {
+        final int feature = version.feature();
+        final boolean hasWebSocketFix =
+                feature >= JDK_WEBSOCKET_FIX_FEATURE_VERSION
+                        || (feature == 11
+                                && version.update() >= 
JDK_11_WEBSOCKET_FIX_UPDATE_VERSION);
+        if (!hasWebSocketFix) {
+            throw new IllegalStateException(

Review Comment:
   what is the reasoning behind selection of `IllegalStateException` here?



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