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/18 07:18:09 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #899: Avoid RejectedExecutionException if engine is shutdown

yaooqinn commented on a change in pull request #899:
URL: https://github.com/apache/incubator-kyuubi/pull/899#discussion_r809730155



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/ExecuteStatement.scala
##########
@@ -112,17 +112,19 @@ class ExecuteStatement(
         }
       }
 
+      val sparkSQLSessionManager = session.sessionManager
       try {
-        val sparkSQLSessionManager = session.sessionManager
         val backgroundHandle = sparkSQLSessionManager.submitBackgroundOperation(asyncOperation)
         setBackgroundHandle(backgroundHandle)
       } catch {
-        case rejected: RejectedExecutionException =>
+        case rejected: RejectedExecutionException if !sparkSQLSessionManager.isShutdown =>
           setState(OperationState.ERROR)
           val ke = KyuubiSQLException("Error submitting query in background, query rejected",

Review comment:
       how about we refine the error message to show that the engine is in shutting down phase.




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