You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Kanna Karanam (JIRA)" <ji...@apache.org> on 2012/06/06 21:28:22 UTC

[jira] [Created] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Kanna Karanam created HADOOP-8486:
-------------------------------------

             Summary: Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
                 Key: HADOOP-8486
                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
             Project: Hadoop Common
          Issue Type: Bug
          Components: fs, io
    Affects Versions: 1.0.2
            Reporter: Kanna Karanam


I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.

Please suggest me if you similar issues in any other places.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399036#comment-13399036 ] 

Kanna Karanam commented on HADOOP-8486:
---------------------------------------

@Sanjay - Trunk has a fix for it already with lot of other code changes so we may not require a patch for it. Please let me know if you see I am missing something. Thanks
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win-(5).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Resolved] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Bikas Saha (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bikas Saha resolved HADOOP-8486.
--------------------------------

    Resolution: Fixed
    
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win-(5).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kanna Karanam updated HADOOP-8486:
----------------------------------

    Attachment: HADOOP-8486-branch-1-win.patch

Attached the patch. 
Unit Tests – Existing unit tests should validate this change. So no new unit tests are required.
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398793#comment-13398793 ] 

Kanna Karanam commented on HADOOP-8486:
---------------------------------------

Attached the fix for build failure.
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win-(5).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Bikas Saha (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398849#comment-13398849 ] 

Bikas Saha commented on HADOOP-8486:
------------------------------------

lgtm. thanks for the quick fix.
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win-(5).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13293826#comment-13293826 ] 

Hadoop QA commented on HADOOP-8486:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12531855/HADOOP-8486-branch-1-win-%283%29.patch
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 1 new or modified test files.

    -1 patch.  The patch command could not apply the patch.

Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1113//console

This message is automatically generated.
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kanna Karanam updated HADOOP-8486:
----------------------------------

        Fix Version/s: 1-win
    Affects Version/s: 1-win
               Status: Patch Available  (was: In Progress)
    
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz Wo (Nicholas), SZE updated HADOOP-8486:
-------------------------------------------

    Assignee: Kanna Karanam
    
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13293802#comment-13293802 ] 

Kanna Karanam commented on HADOOP-8486:
---------------------------------------

Thanks Arun. Added the unit test to catch the regressions.

Note: I didn’t find an efficient way to unit test the file resource leaks on UNIX platform.
 
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Sanjay Radia (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398895#comment-13398895 ] 

Sanjay Radia commented on HADOOP-8486:
--------------------------------------

This patch also directly applies to trunk - can you please provide a trunk patch.
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win-(5).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Work started] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on HADOOP-8486 started by Kanna Karanam.

> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Bikas Saha (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13397222#comment-13397222 ] 

Bikas Saha commented on HADOOP-8486:
------------------------------------

Test looks good! Thanks!
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Sanjay Radia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sanjay Radia updated HADOOP-8486:
---------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

Committed to Hadoop-1 windows branch.
Thanks Kanna.
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kanna Karanam updated HADOOP-8486:
----------------------------------

    Attachment: HADOOP-8486-branch-1-win-(2).patch

Thanks Bikas. Attached the new patch with explicit null initializer change.
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Bikas Saha (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290368#comment-13290368 ] 

Bikas Saha commented on HADOOP-8486:
------------------------------------

If I understand this right, Hive tries to create this object to validate file format and the creation fails often enough for a lot of tests to fail because of this issue. Isn't there a better way to validate the file format.

Back to this, are you sure about calling close() on a partially constructed object?

You are checking for in!=null but there is no explicit initialization of in to null to inform programmers about this dependency. Java default initializes in to null and so this works.
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kanna Karanam updated HADOOP-8486:
----------------------------------

    Attachment: HADOOP-8486-branch-1-win-(3).patch

Attached the patch with unit test
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290389#comment-13290389 ] 

Kanna Karanam commented on HADOOP-8486:
---------------------------------------

Thanks Bikas.
I see it as two issues –

1)	Resource leak – which I am addressing here. (It is better to fix this irrespective of HIVE usage)
2)	Hive improvement – I am investigating to find an alternative to validate the file format without creating Sequence File object. 

< are you sure about calling close() on a partially constructed object>

    I thought of closing the file handle in Init method before throwing exception(s) from various places in the Init method,  but feel like a lot of redundant code. Close function has right protection to handle the partially constructed resources so it is safe to call the close directly from the constructor.

<in !=null>
    We have OpenFile function call in the constructor and it can throw IOException so when we call the close method from constructor it will attempt to close (in.close()) on null object.  

                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Reopened] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Bikas Saha (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bikas Saha reopened HADOOP-8486:
--------------------------------


This has caused build failure because Path.getUriPath is no longer available.
    [javac] c:\Users\bikas\Code\hdp\src\test\org\apache\hadoop\io\TestSequenceFile.java:59: cannot find symbol
    [javac] symbol  : method getUriPath()
    [javac] location: class org.apache.hadoop.fs.Path
    [javac]     File f = new File(nonSeqFile.getUriPath());
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Kanna Karanam (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kanna Karanam updated HADOOP-8486:
----------------------------------

    Attachment: HADOOP-8486-branch-1-win-(5).patch
    
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win-(5).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Bikas Saha (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290403#comment-13290403 ] 

Bikas Saha commented on HADOOP-8486:
------------------------------------

I meant that it would be good to add an explicit in == null initializer to make it clear that we are depending on that because we are not checking in!=null before in.close().
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Sanjay Radia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sanjay Radia updated HADOOP-8486:
---------------------------------

    Attachment: HADOOP-8486-branch-1-win-(4).patch

Ran patch through dos2unix
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2, 1-win
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>             Fix For: 1-win
>
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win-(3).patch, HADOOP-8486-branch-1-win-(4).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HADOOP-8486) Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor

Posted by "Arun C Murthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13292811#comment-13292811 ] 

Arun C Murthy commented on HADOOP-8486:
---------------------------------------

Kanna, the patch looks good. A test case would be useful to ensure we don't regress in the future.

Also, pls mark the patch as 'Patch Available' when you think it's ready so I can track them. Thanks!
                
> Resource leak - Close the open resource handles (File handles) before throwing the exception from the SequenceFile constructor
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8486
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8486
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, io
>    Affects Versions: 1.0.2
>            Reporter: Kanna Karanam
>            Assignee: Kanna Karanam
>         Attachments: HADOOP-8486-branch-1-win-(2).patch, HADOOP-8486-branch-1-win.patch
>
>
> I noticed this problem while I am working on porting HIVE to work on windows. Hive is attempting to create this class object to validate the file format and end up with resource leak. Because of this leak, we can’t move, rename or delete the files on windows when there is an open file handle whereas in UNIX we can perform all these operation with no issues even with open file handles.
> Please suggest me if you similar issues in any other places.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira