Skip to content

Fix SecretCache import failure on Python 3.14 multiprocessing#64501

Merged
potiuk merged 1 commit intoapache:mainfrom
potiuk:fix-cache-conf-import-py314
Mar 30, 2026
Merged

Fix SecretCache import failure on Python 3.14 multiprocessing#64501
potiuk merged 1 commit intoapache:mainfrom
potiuk:fix-cache-conf-import-py314

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Mar 30, 2026

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.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Claude Opus 4.6)

Generated-by: Claude Code (Claude Opus 4.6) following the guidelines

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.
@potiuk potiuk merged commit 7438cbf into apache:main Mar 30, 2026
215 of 216 checks passed
@potiuk potiuk deleted the fix-cache-conf-import-py314 branch March 30, 2026 23:41
potiuk added a commit that referenced this pull request Mar 31, 2026
…sing (#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.
(cherry picked from commit 7438cbf)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
jason810496 pushed a commit that referenced this pull request Mar 31, 2026
…sing (#64501) (#64515)

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.
(cherry picked from commit 7438cbf)
Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Apr 3, 2026
…#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.
Suraj-kumar00 pushed a commit to Suraj-kumar00/airflow that referenced this pull request Apr 7, 2026
…#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.
vatsrahul1001 pushed a commit that referenced this pull request Apr 8, 2026
…sing (#64501) (#64515)

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.
(cherry picked from commit 7438cbf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants