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

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 412e59e34e9 branch-3.0: [fix](jvm) the jvm opt should only be set once 
#48335 (#48342)
412e59e34e9 is described below

commit 412e59e34e9bcc18b32d81045b99e6f05716b1e0
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Feb 26 17:39:31 2025 +0800

    branch-3.0: [fix](jvm) the jvm opt should only be set once #48335 (#48342)
    
    Cherry-picked from #48335
    
    Co-authored-by: Mingyu Chen (Rayner) <morning...@163.com>
---
 be/src/util/jni-util.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/be/src/util/jni-util.cpp b/be/src/util/jni-util.cpp
index 6ad0790ef08..eb71bb449b4 100644
--- a/be/src/util/jni-util.cpp
+++ b/be/src/util/jni-util.cpp
@@ -46,6 +46,7 @@ namespace doris {
 namespace {
 JavaVM* g_vm;
 [[maybe_unused]] std::once_flag g_vm_once;
+[[maybe_unused]] std::once_flag g_jvm_conf_once;
 
 const std::string GetDorisJNIDefaultClasspath() {
     const auto* doris_home = getenv("DORIS_HOME");
@@ -271,7 +272,7 @@ Status JniUtil::GetJNIEnvSlowPath(JNIEnv** env) {
     }
 #else
     // the hadoop libhdfs will do all the stuff
-    SetEnvIfNecessary();
+    std::call_once(g_jvm_conf_once, SetEnvIfNecessary);
     tls_env_ = getJNIEnv();
 #endif
     *env = tls_env_;


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

Reply via email to