You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2021/09/10 20:18:29 UTC

[airflow] branch main updated: Fixed log view for deferred tasks (#18154)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 692d744  Fixed log view for deferred tasks (#18154)
692d744 is described below

commit 692d744e3b8acaf398c5b400eb2264a4e1c915de
Author: Andrew Godwin <an...@astronomer.io>
AuthorDate: Fri Sep 10 14:18:14 2021 -0600

    Fixed log view for deferred tasks (#18154)
    
    Deferred tasks were not showing up in the log view while they were
    deferred, as they decrement the try_number on the way into deferral
    status much like rescheduling sensors. This applies the same fix that
    rescheduling sensors have to make their log appear.
---
 airflow/www/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/www/views.py b/airflow/www/views.py
index 14f7da0..54551f8 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1280,7 +1280,7 @@ class Airflow(AirflowBaseView):
         num_logs = 0
         if ti is not None:
             num_logs = ti.next_try_number - 1
-            if ti.state == State.UP_FOR_RESCHEDULE:
+            if ti.state in (State.UP_FOR_RESCHEDULE, State.DEFERRED):
                 # Tasks in reschedule state decremented the try number
                 num_logs += 1
         logs = [''] * num_logs