Jimmy Xiang created HIVE-11586: ---------------------------------- Summary: ObjectInspectorFactory.getReflectionObjectInspector is not thread-safe Key: HIVE-11586 URL: https://issues.apache.org/jira/browse/HIVE-11586 Project: Hive Issue Type: Bug Reporter: Jimmy Xiang Assignee: Jimmy Xiang
ObjectInspectorFactory#getReflectionObjectInspectorNoCache addes newly create object inspector to the cache before calling its init() method, to allow reusing the cache when dealing with recursive types. So a second thread can then call getReflectionObjectInspector and fetch an uninitialized instance of ReflectionStructObjectInspector. Another issue is that if two threads calls ObjectInspectorFactory.getReflectionObjectInspector at the same time. One thread could get an object inspector not in the cache, i.e. they could both call getReflectionObjectInspectorNoCache() but only one will put the new object inspector to cache successfully. -- This message was sent by Atlassian JIRA (v6.3.4#6332)