Skip to content

Commit

Permalink
[KYUUBI apache#5832] Always perform closing action in OperationLog to…
Browse files Browse the repository at this point in the history
… avoid fd leak

# 🔍 Description
## Issue References 🔗

This pull request fixes apache#5832

## Describe Your Solution 🔧

We should always close writer regardless of whether OperationLog is initialized or not, to prevent other threads from continuing to write.

## 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
- [x] 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
- [x] 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
- [x] 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.
- [x] Milestone correctly set?
- [ ] Test coverage is ok
- [x] Assignees are selected.
- [x] Minimum number of approvals
- [x] No changes are requested

**Be nice. Be informative.**

Closes apache#5854 from Flyangz/fix-op-log-leak.

Closes apache#5832

2549928 [liuyang] fix fd leak when closing KyuubiSession but OperationLog not initialized

Authored-by: liuyang <flyang116@126.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 64ee629)
Signed-off-by: Cheng Pan <chengpan@apache.org>
  • Loading branch information
Flyangz authored and wForget committed Dec 18, 2023
1 parent d9862ff commit d62488f
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ class OperationLog(path: Path) {
}

def close(): Unit = synchronized {
if (!initialized) return

closeExtraReaders()

trySafely {
Expand Down

0 comments on commit d62488f

Please sign in to comment.