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

ObjectStore can leak Queries when rollbackTransaction throws an exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.2, 2.4.0, 3.0.0
    • Component/s: Hive
    • Labels:
      None

      Description

      In ObjectStore.java there are a few places with the code similar to:

          Query query = null;
          try {
            openTransaction();
            query = pm.newQuery(Something.class);
            ...
            commited = commitTransaction();
          } finally {
            if (!commited) {
              rollbackTransaction();
            }
            if (query != null) {
              query.closeAll();
            }
          }
      

      The problem is that rollbackTransaction() may throw an exception in which case query.closeAll() wouldn't be executed.

      The fix would be to wrap rollbackTransaction in its own try-catch block.

        Attachments

        1. HIVE-16213.08.patch
          33 kB
          Vihang Karajgaonkar
        2. HIVE-16213.07.patch
          33 kB
          Vihang Karajgaonkar
        3. HIVE-16213.06.patch
          33 kB
          Vihang Karajgaonkar
        4. HIVE-16213.05.patch
          41 kB
          Vihang Karajgaonkar
        5. HIVE-16213.04.patch
          41 kB
          Vihang Karajgaonkar
        6. HIVE-16213.03.patch
          41 kB
          Vihang Karajgaonkar
        7. HIVE-16213.02.patch
          41 kB
          Vihang Karajgaonkar
        8. HIVE-16213.01.patch
          29 kB
          Vihang Karajgaonkar

          Issue Links

            Activity

              People

              • Assignee:
                vihangk1 Vihang Karajgaonkar
                Reporter:
                akolb Alex Kolbasov
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: