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 2025/04/08 12:52:31 UTC

(doris) 04/04: [tmp] disconnect fs is not used

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-c108335-hive-sql
in repository https://gitbox.apache.org/repos/asf/doris.git

commit a13b871cc42a77ca63c708fddaa332dcda175396
Author: morningman <yu...@selectdb.com>
AuthorDate: Tue Apr 8 20:52:11 2025 +0800

    [tmp] disconnect fs is not used
---
 be/src/io/fs/hdfs/hdfs_mgr.cpp | 1 +
 be/src/io/hdfs_util.h          | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/be/src/io/fs/hdfs/hdfs_mgr.cpp b/be/src/io/fs/hdfs/hdfs_mgr.cpp
index d5cde499a5d..97395a58089 100644
--- a/be/src/io/fs/hdfs/hdfs_mgr.cpp
+++ b/be/src/io/fs/hdfs/hdfs_mgr.cpp
@@ -151,6 +151,7 @@ Status HdfsMgr::get_or_create_fs(const THdfsParams& hdfs_params, const std::stri
             LOG(INFO) << "Another thread created HDFS handler, reuse it, hash_code=" << hash_code
                       << ", is_kerberos=" << it->second->is_kerberos_auth
                       << ", principal=" << it->second->principal << ", fs_name=" << fs_name;
+            new_fs_handler->disconnect();
             it->second->update_access_time();
             *fs_handler = it->second;
             return Status::OK();
diff --git a/be/src/io/hdfs_util.h b/be/src/io/hdfs_util.h
index 2994a26bb49..ef44951f9e2 100644
--- a/be/src/io/hdfs_util.h
+++ b/be/src/io/hdfs_util.h
@@ -67,6 +67,10 @@ public:
     }
 
     void update_access_time() { last_access_time = std::time(nullptr); }
+
+    void disconnect() {
+       hdfsDisconnect(hdfs_fs);
+    }
 };
 
 namespace hdfs_bvar {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org