viirya commented on a change in pull request #17582:
URL: https://github.com/apache/flink/pull/17582#discussion_r747956583



##########
File path: 
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManagerDriver.java
##########
@@ -155,43 +156,49 @@ public void deregisterApplication(
             TaskExecutorProcessSpec taskExecutorProcessSpec) {
         final KubernetesTaskManagerParameters parameters =
                 createKubernetesTaskManagerParameters(taskExecutorProcessSpec);
-        final KubernetesPod taskManagerPod =
-                KubernetesTaskManagerFactory.buildTaskManagerKubernetesPod(
-                        taskManagerPodTemplate, parameters);
-        final String podName = taskManagerPod.getName();
         final CompletableFuture<KubernetesWorkerNode> requestResourceFuture =
                 new CompletableFuture<>();
 
-        requestResourceFutures.put(podName, requestResourceFuture);
-
-        log.info(
-                "Creating new TaskManager pod with name {} and resource 
<{},{}>.",
-                podName,
-                parameters.getTaskManagerMemoryMB(),
-                parameters.getTaskManagerCPU());
-
-        final CompletableFuture<Void> createPodFuture =
-                flinkKubeClient.createTaskManagerPod(taskManagerPod);
-
-        FutureUtils.assertNoException(
-                createPodFuture.handleAsync(
-                        (ignore, exception) -> {
-                            if (exception != null) {
-                                log.warn(
-                                        "Could not create pod {}, exception: 
{}",
-                                        podName,
-                                        exception);
-                                CompletableFuture<KubernetesWorkerNode> future 
=
-                                        
requestResourceFutures.remove(taskManagerPod.getName());
-                                if (future != null) {
-                                    future.completeExceptionally(exception);
+        try {
+            final KubernetesTaskManagerSpecification taskManagerSpec =
+                    KubernetesTaskManagerFactory.buildTaskManagerKubernetesPod(

Review comment:
       Not quite remember the reason. Let me see if I can only put 
`buildTaskManagerKubernetesPod` into the try-catch block.




-- 
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-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to