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 2023/01/03 07:24:58 UTC

[GitHub] [airflow] dstandish commented on a diff in pull request #28440: Propagate logs to stdout when in k8s executor pod

dstandish commented on code in PR #28440:
URL: https://github.com/apache/airflow/pull/28440#discussion_r1060326360


##########
airflow/utils/log/file_task_handler.py:
##########
@@ -92,16 +102,17 @@ def _render_filename(self, ti: TaskInstance, try_number: int) -> str:
         with create_session() as session:
             dag_run = ti.get_dagrun(session=session)
             template = dag_run.get_log_template(session=session).filename
-        str_tpl, jinja_tpl = parse_template_string(template)
+            str_tpl, jinja_tpl = parse_template_string(template)

Review Comment:
   if you look a few lines below, we need to keep `context = ti.get_template_context(session=session)`
   in the same session.  otherwise it creates a new session (provided by provide_session), and this can cause problems post-os.fork.  this is why the test for standard task runner previously blew away the entire log config because. with this, we don't have to do that anymore.



-- 
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