The GitHub Actions job "Tests (AMD)" on airflow.git/v3-2-test has failed.
Run started by GitHub user vatsrahul1001 (triggered by vatsrahul1001).

Head commit for run:
72fab5c3f5ad0549d4cf31f9b135cb096ff423ff / Rahul Vats 
<[email protected]>
Fix macOS `SIGSEGV` in task execution by using `fork`+`exec` (#64874) (#66872)

On macOS, the task supervisor's bare os.fork() copies the parent's
Objective-C runtime state into the child process.  When the child
later triggers ObjC class initialization (e.g. socket.getaddrinfo ->
system DNS resolver -> Security.framework -> +[NSNumber initialize]),
the runtime detects the corrupted state and crashes with SIGABRT/SIGSEGV.

This is a well-documented macOS platform limitation -- Apple's ObjC
runtime, CoreFoundation, and libdispatch are not fork-safe.  CPython
changed multiprocessing's default start method to "spawn" on macOS in
3.8 for this reason, but Airflow's TaskSDK supervisor uses os.fork()
directly.

The fix: on macOS, immediately call os.execv() after os.fork() for
task execution subprocesses.  The exec replaces the child's address
space, giving it clean ObjC state.  The socketpair FDs survive across
exec (marked inheritable) and the child reads their numbers from an
environment variable.

Only task execution (target=_subprocess_main) uses fork+exec.  DAG
processor and triggerer pass different targets and keep bare fork --
they don't make network calls that trigger the macOS crash.

References:
- https://github.com/python/cpython/issues/105912
- https://github.com/python/cpython/issues/58037
- https://github.com/apache/airflow/discussions/24463

(cherry picked from commit a3383b709466595fe0f44264e241c1f33eb34230)

Co-authored-by: Kaxil Naik <[email protected]>

Report URL: https://github.com/apache/airflow/actions/runs/25915513366

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to