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

[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3964: [KYUUBI #3950][FOLLOWUP] Check the background op handle instead of builder process launched

ulysses-you commented on code in PR #3964:
URL: https://github.com/apache/incubator-kyuubi/pull/3964#discussion_r1045521386


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala:
##########
@@ -298,20 +298,22 @@ class BatchJobSubmission(
 
       MetricsSystem.tracing(_.decCount(MetricRegistry.name(OPERATION_OPEN, opType)))
 
-      if (!builder.processLaunched) {
+      // fast fail
+      if (isTerminalState(state)) {
+        killMessage = (false, s"batch $batchId is already terminal so can not kill it.")
         builder.close()
-        if (recoveryMetadata.isDefined) {
-          killMessage = killBatchApplication()
-        }
-        setState(OperationState.CANCELED)
-        updateBatchMetadata()
         return
       }
 
-      // fast fail
-      if (isTerminalState(state)) {
-        killMessage = (false, s"batch $batchId is already terminal so can not kill it.")
+      if (getBackgroundHandle == null) {

Review Comment:
   we should trust the existed state machine to avoid use other flag to see the state. better to check with state `running` and `pending`



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org