You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/31 19:27:03 UTC

[GitHub] [airflow] dstandish commented on a change in pull request #21213: Log traceback in trigger excs

dstandish commented on a change in pull request #21213:
URL: https://github.com/apache/airflow/pull/21213#discussion_r795991779



##########
File path: tests/jobs/test_triggerer_job.py
##########
@@ -448,7 +452,7 @@ def test_invalid_trigger(session, dag_maker):
     job.load_triggers()
 
     # Make sure it turned up in the failed queue
-    assert list(job.runner.failed_triggers) == [1]
+    assert len(job.runner.failed_triggers) == 1

Review comment:
       isn't the before test stricter?

##########
File path: airflow/models/taskinstance.py
##########
@@ -1482,6 +1482,9 @@ def _execute_task(self, context, task_copy):
             # this task was scheduled specifically to fail.
             if self.next_method == "__fail__":
                 next_kwargs = self.next_kwargs or {}
+                traceback = self.next_kwargs.get("traceback")
+                if traceback is not None:
+                    self.log.error("Trigger failed:\n%s", "\n".join(traceback))

Review comment:
       ```suggestion
                       self.log.error("Trigger failed:\n%s", "".join(traceback))
   ```
   when i tested this locally, the lines already were newline-terminated




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org