You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2024/07/02 07:00:05 UTC
(doris) branch master updated: [bugfix](hive)Prevent multiple `fs` from being generated (#36954)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new d33e1a0df63 [bugfix](hive)Prevent multiple `fs` from being generated (#36954)
d33e1a0df63 is described below
commit d33e1a0df6375a271603cdc347f652dc2ec2752f
Author: wuwenchi <wu...@hotmail.com>
AuthorDate: Tue Jul 2 14:59:57 2024 +0800
[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.
---
.../apache/doris/common/security/authentication/HadoopUGI.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/HadoopUGI.java b/fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/HadoopUGI.java
index 5e61664c8fa..1a86b9e327a 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/HadoopUGI.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/HadoopUGI.java
@@ -76,6 +76,16 @@ public class HadoopUGI {
((SimpleAuthenticationConfig) config).setUsername(hadoopUserName);
LOG.debug(AuthenticationConfig.HADOOP_USER_NAME + " is unset, use default user: hadoop");
}
+
+ try {
+ ugi = UserGroupInformation.getLoginUser();
+ if (ugi.getUserName().equals(hadoopUserName)) {
+ return ugi;
+ }
+ } catch (IOException e) {
+ LOG.warn("A SecurityException occurs with simple, do login immediately.", e);
+ }
+
ugi = UserGroupInformation.createRemoteUser(hadoopUserName);
UserGroupInformation.setLoginUser(ugi);
LOG.debug("Login by proxy user, hadoop.username: {}", hadoopUserName);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org