mirror of
https://github.com/apache/impala.git
synced 2025-12-30 03:01:44 -05:00
If an error occurred loading a library in LibCache (e.g. by using CREATE FUNCTION) an error is returned but a cache entry may still exist which may result in strange errors later when the cache entry is accessed by subsequent queries. This changes LibCache::GetCacheEntry to ensure cache entries do not exist if errors occur. Because GetCacheEntry needs to take the global lock and then the cache entry lock, but needs to unlock the global lock before performing slow HDFS operations, we set the error status on the cache entry so that all locks can be released when an error occurs. Other threads that attempt to access the cache entry check the status and return if it is not OK. The first thread (the thread that got the error) can then remove the cache entry whenever it is able to again acquire the global lock_. Change-Id: I00fd0e2a4611b06fa72ffe0aaaa7d077b7a0c36e Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4642 Reviewed-by: Matthew Jacobs <mj@cloudera.com> Tested-by: jenkins
36 lines
921 B
Plaintext
36 lines
921 B
Plaintext
====
|
|
---- QUERY
|
|
create database if not exists udf_test_errors;
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
create function if not exists udf_test_errors.hive_pi() returns double
|
|
location '/test-warehouse/hive-exec.jar'
|
|
symbol='org.apache.hadoop.hive.ql.udf.UDFPI';
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
create function if not exists udf_test_errors.foo() returns double
|
|
location '/test-warehouse/not-a-real-file.so'
|
|
symbol='FnDoesNotExist';
|
|
---- CATCH
|
|
Could not load binary: /test-warehouse/not-a-real-file.so
|
|
====
|
|
---- QUERY
|
|
create function if not exists udf_test_errors.foo() returns double
|
|
location '/test-warehouse/not-a-real-file.so'
|
|
symbol='FnDoesNotExist';
|
|
---- CATCH
|
|
Could not load binary: /test-warehouse/not-a-real-file.so
|
|
====
|
|
---- QUERY
|
|
drop database udf_test_errors;
|
|
---- CATCH
|
|
Cannot drop non-empty database: udf_test_errors
|
|
====
|
|
---- QUERY
|
|
drop function udf_test_errors.hive_pi();
|
|
drop database udf_test_errors;
|
|
---- RESULTS
|
|
====
|