This is an automated email from the ASF dual-hosted git repository.
dstandish 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 7389782fb8 Set mark_end_on_close after set_context (#35761)
7389782fb8 is described below
commit 7389782fb8e441bca4ca1a3f811dd20ad098e0a4
Author: Daniel Standish <[email protected]>
AuthorDate: Tue Nov 21 05:42:18 2023 -0800
Set mark_end_on_close after set_context (#35761)
In ES task handler, set_context applies its own logic for
mark_end_on_close, so it we must set the attr after for our override to persist.
---
airflow/utils/log/task_context_logger.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/airflow/utils/log/task_context_logger.py
b/airflow/utils/log/task_context_logger.py
index 0661789f5b..84ed207e3a 100644
--- a/airflow/utils/log/task_context_logger.py
+++ b/airflow/utils/log/task_context_logger.py
@@ -98,9 +98,9 @@ class TaskContextLogger:
task_handler = copy(self.task_handler)
try:
+ task_handler.set_context(ti, identifier=self.component_name)
if hasattr(task_handler, "mark_end_on_close"):
task_handler.mark_end_on_close = False
- task_handler.set_context(ti, identifier=self.component_name)
filename, lineno, func, stackinfo = logger.findCaller()
record = logging.LogRecord(
self.component_name, level, filename, lineno, msg, args, None,
func=func