Skip to content

Commit 3a87ff6

Browse files
wuwenchidataroaring
authored andcommitted
[bugfix](hive)Prevent multiple fs from being generated (#36954)
If the user has already registered, there is no need to register again, otherwise `fs` will generate multiple instances.
1 parent 62f0b0d commit 3a87ff6

File tree

1 file changed

+10
-0
lines changed
  • fe/fe-common/src/main/java/org/apache/doris/common/security/authentication

1 file changed

+10
-0
lines changed

fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/HadoopUGI.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ private static UserGroupInformation loginWithUGI(AuthenticationConfig config) {
7676
((SimpleAuthenticationConfig) config).setUsername(hadoopUserName);
7777
LOG.debug(AuthenticationConfig.HADOOP_USER_NAME + " is unset, use default user: hadoop");
7878
}
79+
80+
try {
81+
ugi = UserGroupInformation.getLoginUser();
82+
if (ugi.getUserName().equals(hadoopUserName)) {
83+
return ugi;
84+
}
85+
} catch (IOException e) {
86+
LOG.warn("A SecurityException occurs with simple, do login immediately.", e);
87+
}
88+
7989
ugi = UserGroupInformation.createRemoteUser(hadoopUserName);
8090
UserGroupInformation.setLoginUser(ugi);
8191
LOG.debug("Login by proxy user, hadoop.username: {}", hadoopUserName);

0 commit comments

Comments
 (0)