This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 69196d8212c [fix](jvm) the jvm opt should only be set once #48335
(#48336)
69196d8212c is described below
commit 69196d8212c750d22bd7bbddcadb9d306c260596
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Wed Feb 26 09:52:58 2025 +0800
[fix](jvm) the jvm opt should only be set once #48335 (#48336)
bp #48335
---
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 ea171d5d17c..b1bc16a6288 100644
--- a/be/src/util/jni-util.cpp
+++ b/be/src/util/jni-util.cpp
@@ -45,6 +45,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");
@@ -213,7 +214,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: [email protected]
For additional commands, e-mail: [email protected]