Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-11586

ObjectInspectorFactory.getReflectionObjectInspector is not thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 2.0.0
    • None
    • None
    • Reviewed

    Description

      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.

      Attachments

        1. HIVE-11586.2.patch
          17 kB
          Jimmy Xiang
        2. HIVE-11586.1.patch
          17 kB
          Jimmy Xiang

        Activity

          People

            jxiang Jimmy Xiang
            jxiang Jimmy Xiang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: