From 7d755ff8b84dd81725d25b213ff2540e372e8de1 Mon Sep 17 00:00:00 2001 From: HuangWei Date: Wed, 31 Jan 2024 15:52:00 +0800 Subject: [PATCH] fix: job execute again if exception & insert_memory_usage_limit config (#3726) --- .../main/scala/com/_4paradigm/openmldb/batch/SparkPlanner.scala | 2 +- src/sdk/sql_cluster_router.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/SparkPlanner.scala b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/SparkPlanner.scala index 1ab350c42f8..0cf2470dcf8 100644 --- a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/SparkPlanner.scala +++ b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/SparkPlanner.scala @@ -393,7 +393,7 @@ class SparkPlanner(session: SparkSession, config: OpenmldbBatchConfig, sparkAppN case e: Exception => println("Get exception: " + e.getMessage) e.printStackTrace() - body(sqlEngine) + throw e } finally { if (sqlEngine != null) { sqlEngine.close() diff --git a/src/sdk/sql_cluster_router.cc b/src/sdk/sql_cluster_router.cc index bdad16cfc8c..696d83a37cb 100644 --- a/src/sdk/sql_cluster_router.cc +++ b/src/sdk/sql_cluster_router.cc @@ -2891,7 +2891,7 @@ std::shared_ptr SQLClusterRouter::ExecuteSQL( ::openmldb::base::Status base_status; if (is_online_mode) { // Handle in online mode - config.emplace("insert_memory_usage_limit", + config.emplace("spark.insert_memory_usage_limit", std::to_string(insert_memory_usage_limit_.load(std::memory_order_relaxed))); base_status = ImportOnlineData(sql, config, database, is_sync_job, offline_job_timeout, &job_info); } else {