Skip to content

Commit a595705

Browse files
authored
[bugfix](hive)Prevent multiple fs from being generated for 2.0 (#36954) (#38045)
## Proposed changes bp: #36954
1 parent f02c8c7 commit a595705

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ private UserGroupInformation doLogin(Configuration conf) throws UserException {
146146
hadoopUserName = "hadoop";
147147
LOG.debug(HdfsResource.HADOOP_USER_NAME + " is unset, use default user: hadoop");
148148
}
149+
150+
try {
151+
UserGroupInformation ugi = UserGroupInformation.getLoginUser();
152+
if (ugi.getUserName().equals(hadoopUserName)) {
153+
return ugi;
154+
}
155+
} catch (IOException e) {
156+
LOG.warn("A SecurityException occurs with simple, do login immediately.", e);
157+
}
158+
149159
UserGroupInformation ugi = UserGroupInformation.createRemoteUser(hadoopUserName);
150160
UserGroupInformation.setLoginUser(ugi);
151161
LOG.info("Login by proxy user, hadoop.username: {}", hadoopUserName);

0 commit comments

Comments
 (0)