HADOOP-16707. NPE in UGI.getCurrentUser in ITestAbfsIdentityTransformer setup.
Contributed by Steve Loughran. Change-Id: I38fdba2fa70e534d78b15e61de19368912588b0c
This commit is contained in:
parent
dfc61d8ea5
commit
1415ad3800
|
@ -584,6 +584,7 @@ public class UserGroupInformation {
|
|||
@InterfaceAudience.Public
|
||||
@InterfaceStability.Evolving
|
||||
public static UserGroupInformation getCurrentUser() throws IOException {
|
||||
ensureInitialized();
|
||||
AccessControlContext context = AccessController.getContext();
|
||||
Subject subject = Subject.getSubject(context);
|
||||
if (subject == null || subject.getPrincipals(User.class).isEmpty()) {
|
||||
|
@ -670,6 +671,7 @@ public class UserGroupInformation {
|
|||
@InterfaceAudience.Public
|
||||
@InterfaceStability.Evolving
|
||||
public static UserGroupInformation getLoginUser() throws IOException {
|
||||
ensureInitialized();
|
||||
UserGroupInformation loginUser = loginUserRef.get();
|
||||
// a potential race condition exists only for the initial creation of
|
||||
// the login user. there's no need to penalize all subsequent calls
|
||||
|
|
Loading…
Reference in New Issue