Skip to content

Commit

Permalink
Update kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/B…
Browse files Browse the repository at this point in the history
…atchesResource.scala

Co-authored-by: Cheng Pan <pan3793@gmail.com>
  • Loading branch information
zwangsheng and pan3793 committed Oct 25, 2023
1 parent 565b938 commit a238e45
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -478,9 +478,8 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging {
if (OperationState.isTerminal(OperationState.withName(metadata.state))) {
new CloseBatchResponse(false, s"The batch[$metadata] has been terminated.")
} else if (batchV2Enabled(metadata.requestConf) && metadata.state == "INITIALIZED" &&
// Since this code does not retrieve metadata to check,
// the metadata may be outdated, which means that the cancelUnscheduledBatch function
// here will not necessarily succeed
// there is a chance that metadata is outdated, then `cancelUnscheduledBatch` fails
// and returns false
batchService.get.cancelUnscheduledBatch(batchId)) {
new CloseBatchResponse(true, s"Unscheduled batch $batchId is canceled.")
} else if (metadata.kyuubiInstance == null) {
Expand Down

0 comments on commit a238e45

Please sign in to comment.