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

Replace runnables directly added to runtime shutdown hooks to avoid deadlock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.2.0
    • None
    • None

    Description

      deepesh reported that a deadlock can occur when running queries through hive cli. cnauroth analyzed it and reported that hive adds shutdown hooks directly to java Runtime which may execute in non-deterministic order causing deadlocks with hadoop's shutdown hooks. In one case, hadoop shutdown locked FileSystem#Cache and FileSystem.close whereas hive shutdown hook locked FileSystem.close and FileSystem#Cache order causing a deadlock.
      Hive and Hadoop has ShutdownHookManager that runs the shutdown hooks in deterministic order based on priority. We should use that to avoid deadlock throughout the code.

      Attachments

        1. HIVE-14739.1.patch
          12 kB
          Prasanth Jayachandran
        2. HIVE-14739.2.patch
          20 kB
          Prasanth Jayachandran
        3. HIVE-14739.3.patch
          20 kB
          Prasanth Jayachandran
        4. HIVE-14739.4.patch
          20 kB
          Prasanth Jayachandran

        Activity

          People

            prasanth_j Prasanth Jayachandran
            deepesh Deepesh Khandelwal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: