This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new f16cfc11f [KYUUBI #5832] Always perform closing action in OperationLog 
to avoid fd leak
f16cfc11f is described below

commit f16cfc11f0f0ea7bff276cb742e7511e8b03273c
Author: liuyang <[email protected]>
AuthorDate: Fri Dec 15 14:54:03 2023 +0800

    [KYUUBI #5832] Always perform closing action in OperationLog to avoid fd 
leak
    
    # :mag: Description
    ## Issue References ๐Ÿ”—
    
    This pull request fixes #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 :bookmark:
    
    - [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 :coffin:
    
    #### Behavior With This Pull Request :tada:
    
    #### 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 #5854 from Flyangz/fix-op-log-leak.
    
    Closes #5832
    
    2549928f8 [liuyang] fix fd leak when closing KyuubiSession but OperationLog 
not initialized
    
    Authored-by: liuyang <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit 64ee629ed2d93eb28d3f33d70f0cd4f6bfa4f209)
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../src/main/scala/org/apache/kyuubi/operation/log/OperationLog.scala   | 2 --
 1 file changed, 2 deletions(-)

diff --git 
a/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/OperationLog.scala
 
b/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/OperationLog.scala
index 2e133df28..9d7d4bd6b 100644
--- 
a/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/OperationLog.scala
+++ 
b/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/OperationLog.scala
@@ -233,8 +233,6 @@ class OperationLog(path: Path) {
   }
 
   def close(): Unit = synchronized {
-    if (!initialized) return
-
     closeExtraReaders()
 
     trySafely {

Reply via email to