Skip to content

Commit

Permalink
[KYUUBI #5210][FOLLOWUP] Close batch operation log even batch is in c…
Browse files Browse the repository at this point in the history
…ancel state

# 🔍 Description

Followup for #5210

For batch operation, it has similar issue.
#5210 (comment)
## Issue References 🔗

This pull request fixes #

## Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Types of changes 🔖

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklists
## 📝 Author Self Checklist

- [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [ ] I have performed a self-review
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [x] Pull request title is okay.
- [x] No license issues.
- [ ] Milestone correctly set?
- [ ] Test coverage is ok
- [ ] Assignees are selected.
- [ ] Minimum number of approvals
- [ ] No changes are requested

**Be nice. Be informative.**

Closes #5733 from turboFei/batch_log_close.

Closes #5210

e2b72b4 [fwang12] Close batch log even batch is in cancel state

Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
  • Loading branch information
turboFei committed Nov 20, 2023
1 parent dc03687 commit 24fbd57
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,6 @@ class BatchJobSubmission(

override def close(): Unit = withLockRequired {
if (!isClosedOrCanceled) {
try {
getOperationLog.foreach(_.close())
} catch {
case e: IOException => error(e.getMessage, e)
}

MetricsSystem.tracing(_.decCount(MetricRegistry.name(OPERATION_OPEN, opType)))

// fast fail
Expand Down Expand Up @@ -379,6 +373,12 @@ class BatchJobSubmission(
}
}
}

try {
getOperationLog.foreach(_.close())
} catch {
case e: IOException => error(e.getMessage, e)
}
}

override def cancel(): Unit = {
Expand Down

0 comments on commit 24fbd57

Please sign in to comment.