|
@@ -407,7 +407,8 @@ public class UserGroupInformation {
|
|
|
* @return the current user
|
|
|
* @throws IOException if login fails
|
|
|
*/
|
|
|
- public static UserGroupInformation getCurrentUser() throws IOException {
|
|
|
+ public synchronized
|
|
|
+ static UserGroupInformation getCurrentUser() throws IOException {
|
|
|
AccessControlContext context = AccessController.getContext();
|
|
|
Subject subject = Subject.getSubject(context);
|
|
|
return subject == null ? getLoginUser() : new UserGroupInformation(subject);
|