This is an automated email from the ASF dual-hosted git repository.
potiuk 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 7438cbfd4b2 Fix SecretCache import failure on Python 3.14
multiprocessing (#64501)
7438cbfd4b2 is described below
commit 7438cbfd4b26f560a06a3b86ee599547267e2cd3
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Mar 31 01:41:49 2026 +0200
Fix SecretCache import failure on Python 3.14 multiprocessing (#64501)
The `conf` object in `airflow.sdk.configuration` is lazily initialized
via `__getattr__`. Importing it at module level in `cache.py` causes
`ImportError` when the module is deserialized in a multiprocessing child
process on Python 3.14. Moving the import into `SecretCache.init()`
where it's actually used avoids this issue.
---
task-sdk/src/airflow/sdk/execution_time/cache.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/task-sdk/src/airflow/sdk/execution_time/cache.py
b/task-sdk/src/airflow/sdk/execution_time/cache.py
index 7119b4c590d..f3a05936859 100644
--- a/task-sdk/src/airflow/sdk/execution_time/cache.py
+++ b/task-sdk/src/airflow/sdk/execution_time/cache.py
@@ -21,7 +21,6 @@ import datetime
import multiprocessing
from airflow.sdk import timezone
-from airflow.sdk.configuration import conf
class SecretCache:
@@ -55,6 +54,8 @@ class SecretCache:
"""
if cls._cache is not None:
return
+ from airflow.sdk.configuration import conf
+
use_cache = conf.getboolean(section="secrets", key="use_cache",
fallback=False)
if not use_cache:
return