Hive
  1. Hive
  2. HIVE-6364

HiveServer2 - Request serving thread should get class loader from existing SessionState

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13.0
    • Component/s: HiveServer2
    • Labels:
      None

      Description

      SessionState is created for each session in HS2. If we do any add jars, a class loader is set in the SessionState's conf object. This class loader should also be set in each thread that serves request of the same session.

      Scenario (both requests are in the same session)-

      // req 1
      add jar foo.jar // Served by thread th1, this updates class loader and sets in SessionState.conf
      
      // req2 served by th2, such that th1 != th2
      CREATE TEMPORARY FUNCTION foo_udf AS 'some class in foo.jar' 
      // This can throw class not found error, because although 
      // the new thread (th2) gets the same session state as th1,
      // the class loader is different (Thread.currentThread.getContextClassLoader()
      
      

        Issue Links

          Activity

          Ashutosh Chauhan made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 0.13.0 [ 12324986 ]
          Resolution Fixed [ 1 ]
          Jaideep Dhok made changes -
          Assignee Jaideep Dhok [ jaideepdhok ]
          Navis made changes -
          Link This issue duplicates HIVE-3969 [ HIVE-3969 ]
          Jaideep Dhok made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Jaideep Dhok made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Assignee Jaideep Dhok [ jaideepdhok ]
          Jaideep Dhok made changes -
          Attachment HIVE-6364.1.patch [ 12626868 ]
          Jaideep Dhok made changes -
          Component/s HiveServer2 [ 12320408 ]
          Jaideep Dhok made changes -
          Field Original Value New Value
          Summary HiveServer2 should get class loader from existing SessionState HiveServer2 - Request serving thread should get class loader from existing SessionState
          Jaideep Dhok created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Jaideep Dhok
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development