Selaa lähdekoodia

[jb] Show another attempt log if last attempt do not have any task

This prevents the "Could not find any logs" when clicking on the quick
link lob button of a job that add a last reduce step without any attempt.
Romain Rigaux 10 vuotta sitten
vanhempi
commit
8db2dbe
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      apps/jobbrowser/src/jobbrowser/views.py

+ 2 - 0
apps/jobbrowser/src/jobbrowser/views.py

@@ -323,6 +323,8 @@ def job_single_logs(request, job):
   failed_tasks.sort(cmp_exec_time)
   if failed_tasks:
     task = failed_tasks[0]
+    if not task.taskAttemptIds and len(failed_tasks) > 1: # In some cases the last task ends up without any attempt
+      task = failed_tasks[1]
   else:
     task_states = ['running', 'succeeded']
     if job.is_mr2: