Revert "HADOOP-15864. Job submitter / executor fail when SBN domain name can not resolved. Contributed by He Xiaoqiao."
This reverts commit ef9f8ca13d
.
This commit is contained in:
parent
4a1be70099
commit
35e09fe594
|
@ -421,7 +421,7 @@ public final class SecurityUtil {
|
||||||
*/
|
*/
|
||||||
public static void setTokenService(Token<?> token, InetSocketAddress addr) {
|
public static void setTokenService(Token<?> token, InetSocketAddress addr) {
|
||||||
Text service = buildTokenService(addr);
|
Text service = buildTokenService(addr);
|
||||||
if (token != null && service != null) {
|
if (token != null) {
|
||||||
token.setService(service);
|
token.setService(service);
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("Acquired token "+token); // Token#toString() prints service
|
LOG.debug("Acquired token "+token); // Token#toString() prints service
|
||||||
|
@ -441,10 +441,9 @@ public final class SecurityUtil {
|
||||||
String host = null;
|
String host = null;
|
||||||
if (useIpForTokenService) {
|
if (useIpForTokenService) {
|
||||||
if (addr.isUnresolved()) { // host has no ip address
|
if (addr.isUnresolved()) { // host has no ip address
|
||||||
LOG.warn("unable to resolve host name " + addr
|
throw new IllegalArgumentException(
|
||||||
+ ". Failure to construct a correct token service "
|
new UnknownHostException(addr.getHostName())
|
||||||
+ "name may result in operation failures");
|
);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
host = addr.getAddress().getHostAddress();
|
host = addr.getAddress().getHostAddress();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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
|
* HDFS-3062: DistributedFileSystem.getCanonicalServiceName() throws an
|
||||||
* exception if the URI is a logical URI. This bug fails the combination of
|
* exception if the URI is a logical URI. This bug fails the combination of
|
||||||
|
|
Loading…
Reference in New Issue