Skip to content

Commit

Permalink
[KYUUBI #5232] In SparkOperation#cleanup always calls cancelJobGroup …
Browse files Browse the repository at this point in the history
…even though it's in the completed state

### _Why are the changes needed?_

Implement this issue: #5232

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No

Closes #5240 from XorSum/always_cancel_job_group.

Closes #5232

7da16aa [bkhan] In SparkOperation#cleanup always calls cancelJobGroup even though it's in the completed state

Authored-by: bkhan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
XorSum authored and pan3793 committed Sep 4, 2023
1 parent 5abc262 commit 708a0be
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ abstract class SparkOperation(session: Session)
if (!isTerminalState(state)) {
setState(targetState)
Option(getBackgroundHandle).foreach(_.cancel(true))
if (!spark.sparkContext.isStopped) spark.sparkContext.cancelJobGroup(statementId)
}
if (!spark.sparkContext.isStopped) spark.sparkContext.cancelJobGroup(statementId)
}

protected val forceCancel =
Expand Down

0 comments on commit 708a0be

Please sign in to comment.