This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev-2.1.2
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev-2.1.2 by this push:
     new 207caddf0 [Improve] minor improvement
207caddf0 is described below

commit 207caddf0d0f0f08e4dd89be18d81422ec976de0
Author: benjobs <[email protected]>
AuthorDate: Fri Oct 27 08:24:34 2023 +0800

    [Improve] minor improvement
---
 .../streampark/flink/client/impl/RemoteClient.scala  |  1 -
 .../flink/client/trait/FlinkClientTrait.scala        | 20 +++++++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git 
a/streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/impl/RemoteClient.scala
 
b/streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/impl/RemoteClient.scala
index a696e9c7f..27f126f33 100644
--- 
a/streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/impl/RemoteClient.scala
+++ 
b/streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/impl/RemoteClient.scala
@@ -47,7 +47,6 @@ object RemoteClient extends FlinkClientTrait {
     // 2) submit job
     super.trySubmit(submitRequest, flinkConfig, 
submitRequest.userJarFile)(restApiSubmit)(
       jobGraphSubmit)
-
   }
 
   override def doCancel(request: CancelRequest, flinkConfig: Configuration): 
CancelResponse = {
diff --git 
a/streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/trait/FlinkClientTrait.scala
 
b/streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/trait/FlinkClientTrait.scala
index e7da5525e..79d4b9bf8 100644
--- 
a/streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/trait/FlinkClientTrait.scala
+++ 
b/streampark-flink/streampark-flink-client/streampark-flink-client-core/src/main/scala/org/apache/streampark/flink/client/trait/FlinkClientTrait.scala
@@ -206,15 +206,17 @@ trait FlinkClientTrait extends Logger {
     Try {
       logInfo(s"[flink-submit] Attempting to submit in Rest API Submit Plan.")
       restApiFunc(submitRequest, flinkConfig, jarFile)
-    }.getOrElse {
-      logWarn(s"[flink-submit] RestAPI Submit Plan failed,try JobGraph Submit 
Plan now.")
-      Try(jobGraphFunc(submitRequest, flinkConfig, jarFile)) match {
-        case Success(r) => r
-        case Failure(e) =>
-          logError(s"[flink-submit] Both Rest API Submit Plan and JobGraph 
Submit Plan failed.")
-          throw e
-      }
-
+    } match {
+      case Failure(e) =>
+        logWarn(
+          s"[flink-submit] RestAPI Submit Plan failed, error: $e, try JobGraph 
Submit Plan now.")
+        Try(jobGraphFunc(submitRequest, flinkConfig, jarFile)) match {
+          case Success(r) => r
+          case Failure(e) =>
+            logError(s"[flink-submit] Both Rest API Submit Plan and JobGraph 
Submit Plan failed.")
+            throw e
+        }
+      case Success(v) => v
     }
   }
 

Reply via email to