TiDeane commented on issue #35622: URL: https://github.com/apache/airflow/issues/35622#issuecomment-2016423352
@brki I am, and thank you for the suggestion! I'll update the docs along with the bugfix. A little progress update for anyone interested: from the testing I've done, it seems like the bug is caused because `TaskHandlerWithCustomFormatter`'s `set_context` is called multiple times from `logging_mixin`’s `set_context`. Also, I'm not sure if it's intentional, but some `TaskHandlerWithCustomFormatter`'s have their Formatter as a `TimezoneAware` object and each time they still add another prefix. The number of prefixes increases with each call, but caps at 3 (subsequent calls don't add more prefixes). It might just be that the simplest and most efficient solution would be to simply check if the context has already been set at the beginning of `TaskHandlerWithCustomFormatter`'s `set_context`, like was initially suggested. Any alternatives I can think of would either require changing the handlers' structure or slow down execution for every other handler. By adding a simple `if self.prefix_jinja_template is not None: return` at the beginning of the `TaskHandlerWithCustomFormatter`'s `set_context` method the bug is completely fixed, and something similar is done by the ElasticSearch `es_task_handler` as well: https://github.com/apache/airflow/blob/main/airflow/providers/elasticsearch/log/es_task_handler.py#L443. -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org