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

Potential resource leak in HiveSchemaTool#getMetaStoreSchemaVersion()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

            ResultSet res = stmt.executeQuery(versionQuery);
            if (!res.next()) {
              throw new HiveMetaException("Didn't find version data in metastore");
            }
            String currentSchemaVersion = res.getString(1);
            metastoreConn.close();
      

      When HiveMetaException is thrown, metastoreConn.close() would be skipped.
      stmt is not closed upon return from the method.

      Attachments

        1. HIVE-7172.patch
          2 kB
          DJ Choi

        Activity

          People

            lightcourt DJ Choi
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: