kaxil commented on PR #75397: URL: https://github.com/apache/airflow/pull/75397#issuecomment-6339560836
Thanks, but I don't think this bug exists in a real task run. `env` is a template field, so `self.env` is replaced by the rendered value before `execute()` runs, and rendering a dict always builds a new one: https://github.com/apache/airflow/blob/0fb5bfc4df1da8e4f2ae1e436321a8d228630ed3/task-sdk/src/airflow/sdk/definitions/_internal/templater.py#L274-L275. So `get_env()` updates that copy and the user's dict is never touched. On top of that, each task try runs in its own process with a freshly parsed Dag file, so a shared module-level dict can't leak between tasks or retries. The new test only fails because it calls `get_env()` directly and skips rendering, which isn't a path that happens in practice. Closing this one. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
