HADOOP-8585. Fix initialization circularity between UserGroupInformation and HadoopConfiguration. Contributed by Colin Patrick McCabe.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1360498 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8ced7381a4
commit
96d77c17cc
@ -333,6 +333,9 @@ Branch-2 ( Unreleased changes )
|
|||||||
|
|
||||||
HADOOP-8587. HarFileSystem access of harMetaCache isn't threadsafe. (eli)
|
HADOOP-8587. HarFileSystem access of harMetaCache isn't threadsafe. (eli)
|
||||||
|
|
||||||
|
HADOOP-8585. Fix initialization circularity between UserGroupInformation
|
||||||
|
and HadoopConfiguration. (Colin Patrick McCabe via atm)
|
||||||
|
|
||||||
BREAKDOWN OF HDFS-3042 SUBTASKS
|
BREAKDOWN OF HDFS-3042 SUBTASKS
|
||||||
|
|
||||||
HADOOP-8220. ZKFailoverController doesn't handle failure to become active
|
HADOOP-8220. ZKFailoverController doesn't handle failure to become active
|
||||||
|
@ -456,9 +456,6 @@ public class UserGroupInformation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final HadoopConfiguration HADOOP_LOGIN_CONFIG =
|
|
||||||
new HadoopConfiguration();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a javax.security configuration that is created at runtime.
|
* Represents a javax.security configuration that is created at runtime.
|
||||||
*/
|
*/
|
||||||
@ -630,10 +627,10 @@ public class UserGroupInformation {
|
|||||||
LoginContext login;
|
LoginContext login;
|
||||||
if (isSecurityEnabled()) {
|
if (isSecurityEnabled()) {
|
||||||
login = newLoginContext(HadoopConfiguration.USER_KERBEROS_CONFIG_NAME,
|
login = newLoginContext(HadoopConfiguration.USER_KERBEROS_CONFIG_NAME,
|
||||||
subject, HADOOP_LOGIN_CONFIG);
|
subject, new HadoopConfiguration());
|
||||||
} else {
|
} else {
|
||||||
login = newLoginContext(HadoopConfiguration.SIMPLE_CONFIG_NAME,
|
login = newLoginContext(HadoopConfiguration.SIMPLE_CONFIG_NAME,
|
||||||
subject, HADOOP_LOGIN_CONFIG);
|
subject, new HadoopConfiguration());
|
||||||
}
|
}
|
||||||
login.login();
|
login.login();
|
||||||
loginUser = new UserGroupInformation(subject);
|
loginUser = new UserGroupInformation(subject);
|
||||||
@ -774,7 +771,7 @@ public class UserGroupInformation {
|
|||||||
long start = 0;
|
long start = 0;
|
||||||
try {
|
try {
|
||||||
login = newLoginContext(HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME,
|
login = newLoginContext(HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME,
|
||||||
subject, HADOOP_LOGIN_CONFIG);
|
subject, new HadoopConfiguration());
|
||||||
start = System.currentTimeMillis();
|
start = System.currentTimeMillis();
|
||||||
login.login();
|
login.login();
|
||||||
metrics.loginSuccess.add(System.currentTimeMillis() - start);
|
metrics.loginSuccess.add(System.currentTimeMillis() - start);
|
||||||
@ -857,7 +854,7 @@ public class UserGroupInformation {
|
|||||||
// have the new credentials (pass it to the LoginContext constructor)
|
// have the new credentials (pass it to the LoginContext constructor)
|
||||||
login = newLoginContext(
|
login = newLoginContext(
|
||||||
HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, getSubject(),
|
HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, getSubject(),
|
||||||
HADOOP_LOGIN_CONFIG);
|
new HadoopConfiguration());
|
||||||
LOG.info("Initiating re-login for " + keytabPrincipal);
|
LOG.info("Initiating re-login for " + keytabPrincipal);
|
||||||
start = System.currentTimeMillis();
|
start = System.currentTimeMillis();
|
||||||
login.login();
|
login.login();
|
||||||
@ -908,7 +905,7 @@ public class UserGroupInformation {
|
|||||||
//have the new credentials (pass it to the LoginContext constructor)
|
//have the new credentials (pass it to the LoginContext constructor)
|
||||||
login =
|
login =
|
||||||
newLoginContext(HadoopConfiguration.USER_KERBEROS_CONFIG_NAME,
|
newLoginContext(HadoopConfiguration.USER_KERBEROS_CONFIG_NAME,
|
||||||
getSubject(), HADOOP_LOGIN_CONFIG);
|
getSubject(), new HadoopConfiguration());
|
||||||
LOG.info("Initiating re-login for " + getUserName());
|
LOG.info("Initiating re-login for " + getUserName());
|
||||||
login.login();
|
login.login();
|
||||||
setLogin(login);
|
setLogin(login);
|
||||||
@ -945,7 +942,7 @@ public class UserGroupInformation {
|
|||||||
|
|
||||||
LoginContext login = newLoginContext(
|
LoginContext login = newLoginContext(
|
||||||
HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, subject,
|
HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, subject,
|
||||||
HADOOP_LOGIN_CONFIG);
|
new HadoopConfiguration());
|
||||||
|
|
||||||
start = System.currentTimeMillis();
|
start = System.currentTimeMillis();
|
||||||
login.login();
|
login.login();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user