hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Foley (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7146) RPC server leaks file descriptors
Date Mon, 23 May 2011 05:14:47 GMT

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

Matt Foley commented on HADOOP-7146:
------------------------------------

Todd, kudos for finding this and how to fix it, and also to Aaron for nailing the TestDFSStorageStateRecovery
problem.

I'd like to suggest a more structured fix:
1. Move the "readSelector = Selector.open()" statement from Listener() to the Reader() ctor,
and change the ctor to have no arguments.
2. In Reader.run(), wrap the whole method in a try/finally context, with your five-line fix
in the "finally" clause, and make it conditional on (readSelector != null).
3. In Responder.run(), similarly wrap the whole method in a try/finally context, with your
five-line fix in the "finally" clause, and make it conditional on (writeSelector != null).

I would have liked to recommend putting the "readSelector = Selector.open()" [Reader] and
"writeSelector = Selector.open()" [Responder] statements at the beginning of their respective
run() methods, so the try/finally context would really be structured right, but I'm not sure
its okay in the Responder context -- it looks like some of its methods may invoke writeSelector
without the run() being running.

> RPC server leaks file descriptors
> ---------------------------------
>
>                 Key: HADOOP-7146
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7146
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.22.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>             Fix For: 0.22.0
>
>         Attachments: fd-leak.txt, hadoop-7146.txt
>
>
> Both the Listener and Responder thread call Selector.open but don't have a matching .close().
This causes a leak of anonymous pipes. Not a big deal because people rarely close and re-open
servers, but worth fixing.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message