Aitozi commented on a change in pull request #17053:
URL: https://github.com/apache/flink/pull/17053#discussion_r701208062



##########
File path: 
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
##########
@@ -184,12 +184,32 @@ public RestClusterClient(
             T clusterId,
             WaitStrategy waitStrategy)
             throws Exception {
-        this(
-                configuration,
-                restClient,
-                clusterId,
-                waitStrategy,
-                
HighAvailabilityServicesUtils.createClientHAService(configuration));
+        this.configuration = checkNotNull(configuration);
+
+        this.restClusterClientConfiguration =
+                
RestClusterClientConfiguration.fromConfiguration(configuration);
+
+        if (restClient != null) {
+            this.restClient = restClient;
+        } else {
+            this.restClient = new RestClient(configuration, executorService);
+        }
+
+        this.waitStrategy = checkNotNull(waitStrategy);
+        this.clusterId = checkNotNull(clusterId);
+
+        this.clientHAServices =
+                HighAvailabilityServicesUtils.createClientHAService(
+                        configuration,
+                        exception ->
+                                webMonitorLeaderRetriever.handleError(
+                                        new FlinkException(exception)));
+
+        this.webMonitorRetrievalService = 
clientHAServices.getClusterRestEndpointLeaderRetriever();
+        this.retryExecutorService =
+                Executors.newSingleThreadScheduledExecutor(
+                        new 
ExecutorThreadFactory("Flink-RestClusterClient-Retry"));
+        startLeaderRetrievers();

Review comment:
       But I think it's strange to directly terminate the client process. And 
the current `webMonitorRetrievalService` also just complete the future with 
exception. I have to copy the constructor mainly due to there is a constructor 
which accept the `StandaloneClientHAServices`. 




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