Repository: hadoop Updated Branches: refs/heads/branch-3.1 4a1be7009 -> 35e09fe59
Revert "HADOOP-15864. Job submitter / executor fail when SBN domain name can not resolved. Contributed by He Xiaoqiao." This reverts commit ef9f8ca13d8dca8031c045bad801fceb3e00aa15. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/35e09fe5 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/35e09fe5 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/35e09fe5 Branch: refs/heads/branch-3.1 Commit: 35e09fe594f7c8402f8e4938c3371aed84caa1d8 Parents: 4a1be70 Author: Wei-Chiu Chuang <[email protected]> Authored: Sun Oct 28 17:06:40 2018 -0700 Committer: Wei-Chiu Chuang <[email protected]> Committed: Sun Oct 28 17:06:40 2018 -0700 ---------------------------------------------------------------------- .../apache/hadoop/security/SecurityUtil.java | 9 ++++---- .../namenode/ha/TestDelegationTokensWithHA.java | 23 -------------------- 2 files changed, 4 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/35e09fe5/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java index 6aed434..5f8cb29 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java @@ -421,7 +421,7 @@ public final class SecurityUtil { */ public static void setTokenService(Token<?> token, InetSocketAddress addr) { Text service = buildTokenService(addr); - if (token != null && service != null) { + if (token != null) { token.setService(service); if (LOG.isDebugEnabled()) { LOG.debug("Acquired token "+token); // Token#toString() prints service @@ -441,10 +441,9 @@ public final class SecurityUtil { String host = null; if (useIpForTokenService) { if (addr.isUnresolved()) { // host has no ip address - LOG.warn("unable to resolve host name " + addr - + ". Failure to construct a correct token service " - + "name may result in operation failures"); - return null; + throw new IllegalArgumentException( + new UnknownHostException(addr.getHostName()) + ); } host = addr.getAddress().getHostAddress(); } else { http://git-wip-us.apache.org/repos/asf/hadoop/blob/35e09fe5/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java index 087fba1..ca44c79 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java @@ -332,29 +332,6 @@ public class TestDelegationTokensWithHA { } } - @Test(timeout = 300000) - public void testHAUtilClonesDTsDomainNameResolvedFail() throws Exception { - final Token<DelegationTokenIdentifier> token = - getDelegationToken(fs, "JobTracker"); - - UserGroupInformation ugi = UserGroupInformation.createRemoteUser("test"); - - URI haUri = new URI("hdfs://my-ha-uri/"); - token.setService(HAUtilClient.buildTokenServiceForLogicalUri(haUri, - HdfsConstants.HDFS_URI_SCHEME)); - ugi.addToken(token); - - Collection<InetSocketAddress> nnAddrs = new HashSet<InetSocketAddress>(); - nnAddrs.add(new InetSocketAddress("domainname.doesnot.exist", - nn0.getNameNodeAddress().getPort())); - nnAddrs.add(new InetSocketAddress("localhost", - nn1.getNameNodeAddress().getPort())); - HAUtilClient.cloneDelegationTokenForLogicalUri(ugi, haUri, nnAddrs); - - Collection<Token<? extends TokenIdentifier>> tokens = ugi.getTokens(); - assertEquals(3, tokens.size()); - } - /** * HDFS-3062: DistributedFileSystem.getCanonicalServiceName() throws an * exception if the URI is a logical URI. This bug fails the combination of --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
