You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/02/24 02:34:31 UTC

[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1966: [KYUUBI #1960] Skip creating sparksession and starting engine if the max initialization time exceeds

ulysses-you commented on a change in pull request #1966:
URL: https://github.com/apache/incubator-kyuubi/pull/1966#discussion_r813498027



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
##########
@@ -168,15 +169,23 @@ object SparkSQLEngine extends Logging {
 
   def main(args: Array[String]): Unit = {
     SignalRegister.registerLogger(logger)
-    var spark: SparkSession = null
-    try {
-      spark = createSpark()
+    val submitTime = kyuubiConf.getOption(KYUUBI_ENGINE_SUBMIT_TIME_KEY) match {
+      case Some(t) => t.toLong
+      case _ => 0L
+    }
+    val initTimeout = kyuubiConf.get(ENGINE_INIT_TIMEOUT)
+    if (System.currentTimeMillis() - submitTime > initTimeout) {
+      warn("The engine will exit immediately, due to exceeding the maximum initialization time.")
+    } else {
+      var spark: SparkSession = null
       try {
-        startEngine(spark)
-        // blocking main thread
-        countDownLatch.await()
-      } catch {
-        case e: KyuubiException => currentEngine match {
+        spark = createSpark()

Review comment:
       the indention seems not correct ? 




-- 
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: commits-unsubscribe@kyuubi.apache.org

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