You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2023/12/15 06:54:13 UTC

(kyuubi) branch master updated: [KYUUBI #5832] Always perform closing action in OperationLog to avoid fd leak

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

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


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

commit 64ee629ed2d93eb28d3f33d70f0cd4f6bfa4f209
Author: liuyang <fl...@126.com>
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 <fl...@126.com>
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 .../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 9ee5e8a18..b3bd46d35 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
@@ -232,8 +232,6 @@ class OperationLog(path: Path) {
   }
 
   def close(): Unit = synchronized {
-    if (!initialized) return
-
     closeExtraReaders()
 
     trySafely {