You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/24 11:00:00 UTC

[jira] [Commented] (FLINK-8146) Potential resource leak in PythonPlanBinder#unzipPythonLibrary

    [ https://issues.apache.org/jira/browse/FLINK-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16337393#comment-16337393 ] 

ASF GitHub Bot commented on FLINK-8146:
---------------------------------------

GitHub user zentol opened a pull request:

    https://github.com/apache/flink/pull/5349

    [FLINK-8146][py] Properly close ZipInputStream

    ## What is the purpose of the change
    
    This PR fixes a resource-leak caused by an unclosed `ZipInputStream`. We now use a try-with-resource block to ensure that the stream is closed.
    
    ## Verifying this change
    
    This change is a trivial rework / code cleanup without any test coverage.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zentol/flink 8146

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/5349.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5349
    
----
commit 7298ed20be64792bdc9ba4205ad47b2f1be1289a
Author: zentol <ch...@...>
Date:   2018-01-24T10:56:25Z

    [FLINK-8146][py] Properly close ZipInputStream

----


> Potential resource leak in PythonPlanBinder#unzipPythonLibrary
> --------------------------------------------------------------
>
>                 Key: FLINK-8146
>                 URL: https://issues.apache.org/jira/browse/FLINK-8146
>             Project: Flink
>          Issue Type: Bug
>          Components: Python API
>    Affects Versions: 1.4.0, 1.5.0
>            Reporter: Ted Yu
>            Assignee: Chesnay Schepler
>            Priority: Major
>             Fix For: 1.5.0, 1.4.1
>
>
> {code}
>     while (entry != null) {
> ...
>     }
>     zis.closeEntry();
> {code}
> Looking at the catch block inside the loop, it seems the intention is to close zis upon getting exception.
> zis.close() should be called outside the loop.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)