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

ASF GitHub Bot commented on ORC-301:
------------------------------------

GitHub user dongjoon-hyun opened a pull request:

    https://github.com/apache/orc/pull/218

    [ORC-301] `extractFileTail` should open a file in `try` statement

    This PR moves the file open position to prevent opened file leakage more 
robustly.

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

    $ git pull https://github.com/dongjoon-hyun/orc ORC-301

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

    https://github.com/apache/orc/pull/218.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 #218
    
----
commit 28c4a2f1f58b2037602366052e3411068ee23762
Author: Dongjoon Hyun <dongjoon@...>
Date:   2018-02-14T23:07:24Z

    [ORC-301] `extractFileTail` should open a file in `try` statement

----


> `extractFileTail` should open a file in `try` statement
> -------------------------------------------------------
>
>                 Key: ORC-301
>                 URL: https://issues.apache.org/jira/browse/ORC-301
>             Project: ORC
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 1.4.1
>            Reporter: Dongjoon Hyun
>            Priority: Major
>
> To prevent opened file leakage, we need to move the file open position.
> {code}
> --- a/java/core/src/java/org/apache/orc/impl/ReaderImpl.java
>        long maxFileLength) throws IOException {
> -    FSDataInputStream file = fs.open(path);
> +    FSDataInputStream file = null;
>      ByteBuffer buffer;
>      OrcProto.PostScript ps;
>      OrcProto.FileTail.Builder fileTailBuilder = 
> OrcProto.FileTail.newBuilder();
>      long modificationTime;
>      try {
> +      file = fs.open(path);
> {code}



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

Reply via email to