Explorar o código

HUE-4129 [impala] Long running query getting terminated when leaving the editor

Canceling running notebook/snippets is expected, before closing them.
Romain Rigaux %!s(int64=9) %!d(string=hai) anos
pai
achega
1444af2
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      desktop/libs/notebook/src/notebook/api.py

+ 4 - 1
desktop/libs/notebook/src/notebook/api.py

@@ -467,7 +467,10 @@ def close_notebook(request):
 
   for snippet in [_s for _s in notebook['snippets'] if _s['type'] in ('hive', 'impala')]:
     try:
-      response['result'] = get_api(request, snippet).close_statement(snippet)
+      if snippet['status'] != 'running':
+        response['result'].append(get_api(request, snippet).close_statement(snippet))
+      else:
+        LOG.info('Not closing SQL snippet as still running.')
     except QueryExpired:
       pass
     except Exception, e: