Commit ca6ab4e
committed
The "Parallel cache failure" test failure
this had two root causes, both related to Python 3.14's new default
multiprocessing start method (forkserver, via PEP 741):
Root Cause 1: `spawning_platform()` didn't recognize `forkserver`
salt/utils/platform.py only checked for "spawn", not "forkserver". This
caused AttributeError: 'Process' object has no attribute
'_args_for_getstate' because Process.__new__ didn't set up pickling
support for forkserver-spawned children. Fix: Changed
spawning_platform() to return True for both "spawn" and "forkserver".
Root Cause 2: Circular import when `extmods/utils/platform.py` shadows
stdlib
In Python 3.14, the forkserver itself is a fresh Python process (spawned
via exec). When it creates child processes:
1. It sets sys.path from the parent salt-call process via
preparation_data
2. The parent's sys.path had extmods/utils/ at index 0 (inserted by
insert_system_path)
3. In the fresh child, import platform found extmods/utils/platform.py
(salt's platform util) before stdlib's platform.py
4. extmods/utils/platform.py does from salt.utils.decorators import
memoize which creates a circular import: • salt.utils.decorators →
salt.utils.versions → salt.version → import platform → (itself) →
salt.utils.decorators ♻️
Fix 1 (targeted): Replaced from salt.utils.decorators import memoize as
real_memoize in salt/utils/platform.py with
functools.lru_cache(maxsize=None) — a stdlib-only alternative that
breaks the circular dependency. Fix 2 (defensive): Changed
insert_system_path() in salt/config/__init__.py from sys.path.insert(0,
...) to sys.path.append(...), so extension module directories never
appear before stdlib paths.1 parent 7e2de42 commit ca6ab4e
3 files changed
Lines changed: 63 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2352 | 2352 | | |
2353 | 2353 | | |
2354 | 2354 | | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
2355 | 2363 | | |
2356 | 2364 | | |
2357 | 2365 | | |
2358 | 2366 | | |
2359 | 2367 | | |
2360 | 2368 | | |
2361 | 2369 | | |
2362 | | - | |
| 2370 | + | |
2363 | 2371 | | |
2364 | 2372 | | |
2365 | 2373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
| |||
237 | 247 | | |
238 | 248 | | |
239 | 249 | | |
240 | | - | |
| 250 | + | |
| 251 | + | |
241 | 252 | | |
242 | | - | |
243 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
244 | 262 | | |
245 | | - | |
| 263 | + | |
246 | 264 | | |
247 | 265 | | |
248 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments