anshuman0123 opened a new pull request, #68379: URL: https://github.com/apache/airflow/pull/68379
## Summary - Fix remote logging connection caching in Task SDK to resolve regression in Airflow 3.2.2. - Prevent caching of `None` results for connection lookups in the supervisor. ## Details In the new two-token execution mechanism, a worker starts with a **workload-scoped token** which lacks permission to access connections. The connection preloading logic attempts to fetch connections, receives **None**, and was previously caching this empty result. Later, when the task runs and the worker's token is upgraded to an **execution-scoped token** (which has connection access), the system continued to use the cached **None** value, preventing hooks from finding the necessary credentials. The fix modifies `_fetch_remote_logging_conn` in `task-sdk/src/airflow/sdk/execution_time/supervisor.py` to only cache truthy connection results. By not caching **None**, the worker is forced to re-attempt the connection lookup later (e.g., during log upload) when it has the correct token scope, allowing it to successfully retrieve the connection details. ## Testing - Verified that `_fetch_remote_logging_conn` no longer caches **None** values when lookups fail. - Verified that subsequent lookups successfully re-attempt connection retrieval. Fixes: #68366 -- 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]
