wsjz commented on code in PR #19819: URL: https://github.com/apache/doris/pull/19819#discussion_r1214047256
########## be/src/vec/exec/jni_connector.cpp: ########## @@ -63,14 +63,15 @@ JniConnector::~JniConnector() { } Status JniConnector::open(RuntimeState* state, RuntimeProfile* profile) { - RETURN_IF_ERROR(JniUtil::GetJNIEnv(&_env)); - if (_env == nullptr) { + JNIEnv* env = nullptr; + RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env)); + if (env == nullptr) { return Status::InternalError("Failed to get/create JVM"); } - RETURN_IF_ERROR(_init_jni_scanner(_env, state->batch_size())); + RETURN_IF_ERROR(_init_jni_scanner(env, state->batch_size())); // Call org.apache.doris.jni.JniScanner#open - _env->CallVoidMethod(_jni_scanner_obj, _jni_scanner_open); - RETURN_ERROR_IF_EXC(_env); + env->CallVoidMethod(_jni_scanner_obj, _jni_scanner_open); + RETURN_ERROR_IF_EXC(env); Review Comment: env is thread local in jvm -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org