Explorar o código

HUE-2212 [metastore] Memory can leak when getting a sample of data of a table

Romain Rigaux %!s(int64=11) %!d(string=hai) anos
pai
achega
fb0615d
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      apps/beeswax/src/beeswax/server/dbms.py

+ 6 - 0
apps/beeswax/src/beeswax/server/dbms.py

@@ -348,12 +348,18 @@ class HiveServer2Dbms(object):
     handle = self.client.query(query)
     curr = time.time()
     end = curr + timeout_sec
+
     while curr <= end:
       state = self.client.get_state(handle)
       if state not in (QueryHistory.STATE.running, QueryHistory.STATE.submitted):
         return handle
       time.sleep(sleep_interval)
       curr = time.time()
+
+    try:
+      self.cancel_operation(handle)
+    except:
+      self.close_operation(handle)
     return None