This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new a595705f9e4 [bugfix](hive)Prevent multiple fs from being generated for
2.0 (#36954) (#38045)
a595705f9e4 is described below
commit a595705f9e437b4d4ecaa9bda71cb339d266bcdc
Author: wuwenchi <[email protected]>
AuthorDate: Tue Jul 23 11:11:44 2024 +0800
[bugfix](hive)Prevent multiple fs from being generated for 2.0 (#36954)
(#38045)
## Proposed changes
bp: #36954
---
.../java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java
b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java
index fca264126cf..25ecafda468 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java
@@ -146,6 +146,16 @@ public class DFSFileSystem extends RemoteFileSystem {
hadoopUserName = "hadoop";
LOG.debug(HdfsResource.HADOOP_USER_NAME + " is unset, use
default user: hadoop");
}
+
+ try {
+ UserGroupInformation ugi = UserGroupInformation.getLoginUser();
+ if (ugi.getUserName().equals(hadoopUserName)) {
+ return ugi;
+ }
+ } catch (IOException e) {
+ LOG.warn("A SecurityException occurs with simple, do login
immediately.", e);
+ }
+
UserGroupInformation ugi =
UserGroupInformation.createRemoteUser(hadoopUserName);
UserGroupInformation.setLoginUser(ugi);
LOG.info("Login by proxy user, hadoop.username: {}",
hadoopUserName);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]