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

eladkal 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 297ad80c7d Move Post Execution Log Grouping behind Exception Print 
(#40146)
297ad80c7d is described below

commit 297ad80c7d5799b3cefcd58366d986a5ad4b43dd
Author: Jens Scheffler <[email protected]>
AuthorDate: Sat Jun 8 23:07:31 2024 +0200

    Move Post Execution Log Grouping behind Exception Print (#40146)
---
 airflow/models/taskinstance.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index 087b0f2249..c1ace17cd5 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -334,6 +334,9 @@ def _run_raw_task(
             ti.handle_failure(e, test_mode, context, session=session)
             raise
         finally:
+            # Print a marker post execution for internals of post task 
processing
+            log.info("::group::Post task execution logs")
+
             Stats.incr(
                 f"ti.finish.{ti.dag_id}.{ti.task_id}.{ti.state}",
                 tags=ti.stats_tags,
@@ -730,9 +733,6 @@ def _execute_task(task_instance: TaskInstance | 
TaskInstancePydantic, context: C
             if e.code is not None and e.code != 0:
                 raise
             return None
-        finally:
-            # Print a marker post execution for internals of post task 
processing
-            log.info("::group::Post task execution logs")
 
     # If a timeout is specified for the task, make it fail
     # if it goes beyond

Reply via email to