Преглед изворни кода

HUE-6407 [pig] Play button doesn't come back after killing the running pig job

We check for a specific end pattern to set is_really_done. But if the job
is killed the logs don't end with this pattern and is_really_done is always
false.
krish пре 8 година
родитељ
комит
9113fa7
2 измењених фајлова са 5 додато и 2 уклоњено
  1. 1 1
      apps/oozie/src/oozie/views/api.py
  2. 4 1
      apps/pig/src/pig/templates/app.mako

+ 1 - 1
apps/oozie/src/oozie/views/api.py

@@ -451,7 +451,7 @@ def get_log(request, oozie_workflow, make_links=True, log_start_pattern=None, lo
 
           if log_end_pattern:
             re_log_end = re.compile(log_end_pattern)
-            is_really_done = re_log_end.search(action_logs) is not None
+            is_really_done = re_log_end.search(action_logs) is not None or oozie_workflow.status == 'KILLED'
             if is_really_done and not action_logs:
               LOG.warn('Unable to scrape full logs, try increasing the jobbrowser log_offset configuration value.')
     except Exception:

+ 4 - 1
apps/pig/src/pig/templates/app.mako

@@ -1202,6 +1202,8 @@ ${ commonshare() | n,unicode }
       });
     }
 
+    var refreshLogsTimeout = null;
+
     function refreshLogs() {
       if (viewModel.currentScript().watchUrl() != "") {
         $.getJSON(viewModel.currentScript().watchUrl(), function (data) {
@@ -1244,7 +1246,7 @@ ${ commonshare() | n,unicode }
             else {
               $.jHueTitleUpdater.reset();
             }
-            window.setTimeout(function () {
+            refreshLogsTimeout = window.setTimeout(function () {
               refreshLogs();
             }, 1000);
           }
@@ -1252,6 +1254,7 @@ ${ commonshare() | n,unicode }
             viewModel.currentScript().actions(data.workflow.actions);
             viewModel.currentScript().isRunning(false);
             $.jHueTitleUpdater.reset();
+            clearTimeout(refreshLogsTimeout);
           }
         });
       }