You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Zheng Shao (JIRA)" <ji...@apache.org> on 2010/04/29 02:19:50 UTC
[jira] Created: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
DFSOutputStream socket leak when cannot connect to DataNode
-----------------------------------------------------------
Key: HDFS-1118
URL: https://issues.apache.org/jira/browse/HDFS-1118
Project: Hadoop HDFS
Issue Type: Bug
Affects Versions: 0.20.2, 0.20.1
Reporter: Zheng Shao
Assignee: Zheng Shao
The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zheng Shao updated HDFS-1118:
-----------------------------
Status: Patch Available (was: Open)
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.2, 0.20.1
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zheng Shao updated HDFS-1118:
-----------------------------
Status: Patch Available (was: Open)
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.2, 0.20.1
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zheng Shao updated HDFS-1118:
-----------------------------
Attachment: HDFS-1118.2.patch
Moved the cleanup to finally section.
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HDFS-1118) DFSOutputStream socket leak when
cannot connect to DataNode
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862031#action_12862031 ]
Hadoop QA commented on HDFS-1118:
---------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12443148/HDFS-1118.1.patch
against trunk revision 939091.
+1 @author. The patch does not contain any @author tags.
-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no new tests are needed for this patch.
Also please list what manual steps were performed to verify this patch.
-1 patch. The patch command could not apply the patch.
Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/165/console
This message is automatically generated.
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zheng Shao updated HDFS-1118:
-----------------------------
Status: Patch Available (was: Open)
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.2, 0.20.1
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HDFS-1118) DFSOutputStream socket leak when
cannot connect to DataNode
Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862095#action_12862095 ]
dhruba borthakur commented on HDFS-1118:
----------------------------------------
+1 good catch. awesome!
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HDFS-1118) DFSOutputStream socket leak when
cannot connect to DataNode
Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876084#action_12876084 ]
Todd Lipcon commented on HDFS-1118:
-----------------------------------
Hey Zheng. I was just running into this problem and then remembered that you put this patch up a while back.
Why not just add an IOUtils.closeSocket() call inside the IOException catch clause, instead of adding the finally {} clause?
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.1, 0.20.2, 0.20-append
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Fix For: 0.20-append
>
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zheng Shao updated HDFS-1118:
-----------------------------
Attachment: HDFS-1118.1.patch
This patch does not have a unit test yet. Not sure what is the best way to write one for this.
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
dhruba borthakur updated HDFS-1118:
-----------------------------------
Attachment: trunkPatch.txt
Patch for apache hadop trunk.
Todd: the finally clause should not hurt, will catch all types of exceptions and cleanup the socket.
Looks ok without a unit test, because the code is simple and I agree with Zheng that it is difficult to write a unit test
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20-append, 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Fix For: 0.20-append
>
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch, trunkPatch.txt
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HDFS-1118) DFSOutputStream socket leak when
cannot connect to DataNode
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12880609#action_12880609 ]
Hudson commented on HDFS-1118:
------------------------------
Integrated in Hadoop-Hdfs-trunk-Commit #315 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/315/])
HDFS-1118. Fix socketleak on DFSClient.
(Zheng Shao via dhruba)
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20-append, 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Fix For: 0.20-append, 0.22.0
>
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch, trunkPatch.txt
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
dhruba borthakur updated HDFS-1118:
-----------------------------------
Status: Resolved (was: Patch Available)
Hadoop Flags: [Reviewed]
Fix Version/s: 0.22.0
Resolution: Fixed
I just committed this. Thanks Zheng.
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20-append, 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Fix For: 0.20-append, 0.22.0
>
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch, trunkPatch.txt
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zheng Shao updated HDFS-1118:
-----------------------------
Status: Open (was: Patch Available)
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.2, 0.20.1
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Todd Lipcon updated HDFS-1118:
------------------------------
Fix Version/s: 0.20-append
Affects Version/s: 0.20-append
Marking this for 0.20-append
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.1, 0.20.2, 0.20-append
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Fix For: 0.20-append
>
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HDFS-1118) DFSOutputStream socket leak when
cannot connect to DataNode
Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12879626#action_12879626 ]
dhruba borthakur commented on HDFS-1118:
----------------------------------------
Code looks good to me. I will commit this to trunk.
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20-append, 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Fix For: 0.20-append
>
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HDFS-1118) DFSOutputStream socket leak when
cannot connect to DataNode
Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862018#action_12862018 ]
Todd Lipcon commented on HDFS-1118:
-----------------------------------
Great catch, Zheng! I've seen leaked sockets before but never been able to figure out what the cause was.
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.1, 0.20.2
> Reporter: Zheng Shao
> Assignee: Zheng Shao
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HDFS-1118) DFSOutputStream socket leak when cannot
connect to DataNode
Posted by "Zheng Shao (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HDFS-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zheng Shao updated HDFS-1118:
-----------------------------
Status: Open (was: Patch Available)
> DFSOutputStream socket leak when cannot connect to DataNode
> -----------------------------------------------------------
>
> Key: HDFS-1118
> URL: https://issues.apache.org/jira/browse/HDFS-1118
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.2, 0.20.1
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Attachments: HDFS-1118.1.patch, HDFS-1118.2.patch
>
>
> The offending code is in {{DFSOutputStream.nextBlockOutputStream}}
> This function retries several times to call {{createBlockOutputStream}}. Each time when it fails, it leaves a {{Socket}} object in {{DFSOutputStream.s}}.
> That object is never closed, but overwritten the next time {{createBlockOutputStream}} is called.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.