[Bug](udf) java-udf function open failed cause BE core dump #28063

when the java-udf open function failed, and some JNI have not set,
so in close function can't call jni.
This commit is contained in:
zhangstar333
2023-12-09 11:00:30 +08:00
committed by GitHub
parent 42aa174405
commit 363721e066
2 changed files with 6 additions and 0 deletions

View File

@ -123,10 +123,15 @@ private:
jmethodID executor_close_id;
jobject executor = nullptr;
bool is_closed = false;
bool open_successes = false;
JniContext() = default;
void close() {
if (!open_successes) {
LOG_WARNING("maybe open failed, need check the reason");
return; //maybe open failed, so can't call some jni
}
if (is_closed) {
return;
}