Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/17106 )

Change subject: IMPALA-10371: test_java_udfs crash impalad if result spooling 
is enabled
......................................................................

IMPALA-10371: test_java_udfs crash impalad if result spooling is enabled

IMPALA-7658 introduced proper codegen for HiveUdfCall. Because of a bug
in LLVM (see https://bugs.llvm.org/show_bug.cgi?id=21431), codegen code
could not use JniUtil::GetJNIEnv directly as it involves thread-local
variables, which LLVM JIT does not (yet) support. The original solution
to get around this problem was to cache the JNIEnv pointer in the
FunctionContext but it turned out that this leads to a crash if result
spooling is enabled because multiple threads can end up using the same
JNIEnv object.

This commit fixes the problem by using a different solution: instead of
caching the JNIEnv pointer we use a wrapper function
(HiveUdfCall:GetJniEnvNotInlined) that prevents JniUtil::GetJNIEnv from
being inlined in codegen code, thereby ensuring that the handling of the
thread-local variable is compiled by GCC.

Testing:
  Manually verified that TestUdfExecution::test_java_udfs passes with
  SPOOL_QUERY_RESULTS enabled.

Change-Id: Ie3aadb8ccc0f1f9b7b87a5744c22a0555b325ee6
Reviewed-on: http://gerrit.cloudera.org:8080/17106
Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
---
M be/src/exprs/hive-udf-call-ir.cc
M be/src/exprs/hive-udf-call.cc
M be/src/exprs/hive-udf-call.h
3 files changed, 22 insertions(+), 12 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/17106
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3aadb8ccc0f1f9b7b87a5744c22a0555b325ee6
Gerrit-Change-Number: 17106
Gerrit-PatchSet: 5
Gerrit-Owner: Daniel Becker <daniel.bec...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <daniel.bec...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <riza.sumi...@cloudera.com>

Reply via email to