You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/18 07:37:17 UTC

[GitHub] [flink-kubernetes-operator] wangyang0918 commented on a diff in pull request #169: [FLINK-27269] Clean up the jar file after submitting the job

wangyang0918 commented on code in PR #169:
URL: https://github.com/apache/flink-kubernetes-operator/pull/169#discussion_r851946179


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java:
##########
@@ -234,6 +238,22 @@ private JarUploadResponseBody jarUpload(FlinkSessionJob sessionJob, Configuratio
         }
     }
 
+    private void deleteJar(Configuration conf, String jarId) {
+        try (RestClusterClient<String> clusterClient =
+                (RestClusterClient<String>) getClusterClient(conf)) {
+            JarDeleteHeaders headers = JarDeleteHeaders.getInstance();
+            JarDeleteMessageParameters parameters = headers.getUnresolvedMessageParameters();
+            parameters.jarIdPathParameter.resolve(jarId);
+            clusterClient
+                    .sendRequest(headers, parameters, EmptyRequestBody.getInstance())
+                    .get(
+                            operatorConfiguration.getFlinkClientTimeout().toSeconds(),
+                            TimeUnit.SECONDS);
+        } catch (Exception e) {
+            LOG.error("Failed to delete the jar.", e);

Review Comment:
   We need to print the `jarId` when failed.



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