This is an automated email from the ASF dual-hosted git repository. inigoiri pushed a commit to branch branch-3.1 in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.1 by this push: new 3ab4753 HADOOP-16385. Namenode crashes with 'RedundancyMonitor thread received Runtime exception'. Contributed by Ayush Saxena. 3ab4753 is described below commit 3ab475377a9311be5d8988df5a05154e7de2f5a3 Author: Inigo Goiri <inigo...@apache.org> AuthorDate: Tue Jul 2 13:22:30 2019 -0700 HADOOP-16385. Namenode crashes with 'RedundancyMonitor thread received Runtime exception'. Contributed by Ayush Saxena. (cherry picked from commit aa9f0850e85203b2ce4f4a8dc8968e9186cdc67a) --- .../src/main/java/org/apache/hadoop/net/NetworkTopology.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java index f7f60ec..8933b07 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java @@ -569,10 +569,11 @@ public class NetworkTopology { private Node chooseRandom(final InnerNode parentNode, final Node excludedScopeNode, final Collection<Node> excludedNodes, final int totalInScopeNodes, final int availableNodes) { - Preconditions.checkArgument( - totalInScopeNodes >= availableNodes && availableNodes > 0, String - .format("%d should >= %d, and both should be positive.", - totalInScopeNodes, availableNodes)); + if (totalInScopeNodes < availableNodes) { + LOG.warn("Total Nodes in scope : {} are less than Available Nodes : {}", + totalInScopeNodes, availableNodes); + return null; + } if (excludedNodes == null || excludedNodes.isEmpty()) { // if there are no excludedNodes, randomly choose a node final int index = r.nextInt(totalInScopeNodes); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org