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

Fix resource leak in HiveClientCache

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.1, 2.0.0
    • 2.2.0
    • Clients
    • None

    Description

      Found that the users reference count can go into negative values, which prevents tearDownIfUnused from closing the client connection when called.
      This leads to a build up of clients which have been evicted from the cache, are no longer in use, but have not been shutdown.
      GC will eventually call finalize, which forcibly closes the connection and cleans up the client, but I have seen as many as several hundred open client connections as a result.

      The main resource for this is caused by RetryingMetaStoreClient, which will call reconnect on acquire, which calls close. This will decrement users to -1 on the reconnect, then acquire will increase this to 0 while using it, and back to -1 when it releases it.

      Attachments

        1. HIVE-13754-branch-1.patch
          27 kB
          Chris Drome
        2. HIVE-13754.patch
          28 kB
          Chris Drome
        3. HIVE-13754.1-branch-1.patch
          27 kB
          Chris Drome
        4. HIVE-13754.1.patch
          28 kB
          Chris Drome

        Activity

          People

            cdrome Chris Drome
            cdrome Chris Drome
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: