HADOOP-10953. NetworkTopology#add calls NetworkTopology#toString without holding the netlock (Liang Xie via Colin P. McCabe)
This commit is contained in:
parent
3f5431a22f
commit
6338ce3ae8
@ -889,6 +889,9 @@ Release 2.7.0 - UNRELEASED
|
|||||||
HADOOP-11535 TableMapping related tests failed due to 'successful'
|
HADOOP-11535 TableMapping related tests failed due to 'successful'
|
||||||
resolving of invalid test hostname. (Kai Zheng via stevel)
|
resolving of invalid test hostname. (Kai Zheng via stevel)
|
||||||
|
|
||||||
|
HADOOP-10953. NetworkTopology#add calls NetworkTopology#toString without
|
||||||
|
holding the netlock (Liang Xie via Colin P. McCabe)
|
||||||
|
|
||||||
Release 2.6.1 - UNRELEASED
|
Release 2.6.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -393,14 +393,14 @@ public NetworkTopology() {
|
|||||||
*/
|
*/
|
||||||
public void add(Node node) {
|
public void add(Node node) {
|
||||||
if (node==null) return;
|
if (node==null) return;
|
||||||
String oldTopoStr = this.toString();
|
|
||||||
if( node instanceof InnerNode ) {
|
|
||||||
throw new IllegalArgumentException(
|
|
||||||
"Not allow to add an inner node: "+NodeBase.getPath(node));
|
|
||||||
}
|
|
||||||
int newDepth = NodeBase.locationToDepth(node.getNetworkLocation()) + 1;
|
int newDepth = NodeBase.locationToDepth(node.getNetworkLocation()) + 1;
|
||||||
netlock.writeLock().lock();
|
netlock.writeLock().lock();
|
||||||
try {
|
try {
|
||||||
|
String oldTopoStr = this.toString();
|
||||||
|
if( node instanceof InnerNode ) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"Not allow to add an inner node: "+NodeBase.getPath(node));
|
||||||
|
}
|
||||||
if ((depthOfAllLeaves != -1) && (depthOfAllLeaves != newDepth)) {
|
if ((depthOfAllLeaves != -1) && (depthOfAllLeaves != newDepth)) {
|
||||||
LOG.error("Error: can't add leaf node " + NodeBase.getPath(node) +
|
LOG.error("Error: can't add leaf node " + NodeBase.getPath(node) +
|
||||||
" at depth " + newDepth + " to topology:\n" + oldTopoStr);
|
" at depth " + newDepth + " to topology:\n" + oldTopoStr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user