[
https://issues.apache.org/jira/browse/HADOOP-3360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594929#action_12594929
]
Raghu Angadi commented on HADOOP-3360:
--------------------------------------
> Consider splitting the constructor from the start() operation.
I think this can be done with simple changes. An option is to split
{{startDataNode()}} into {{initDataNode()}} and {{startDataNode()}} that starts
the threads. The constructor would call initDataNode, and makeInstance() would
invoke startDataNode() after constructing a DataNode.
> DataNode should be marked as final to prevent subclassing
> ---------------------------------------------------------
>
> Key: HADOOP-3360
> URL: https://issues.apache.org/jira/browse/HADOOP-3360
> Project: Hadoop Core
> Issue Type: Bug
> Components: dfs
> Affects Versions: 0.16.3
> Reporter: Steve Loughran
> Priority: Minor
>
> Reviewing the DataNode core, it starts a thread in its constructor calling
> back in to the Run() method. This is generally perceived as very dangerous,
> as if DataNode were ever subclassed, the subclass would start to be invoked
> in the run() method before its own constructor had finished working.
> 1. Consider splitting the constructor from the start() operation.
> 2. If this cannot be changed, mark DataNode as final so nobody can subclass
> it. Though if the latter were done, it would be convenient to have a method
> to let external management components poll for the health of the node, and to
> pick up reasons for the node shutting down.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.