pulaksaha143 opened a new pull request, #71723:
URL: https://github.com/apache/airflow/pull/71723

   Resolves #71707.
   
   ### Problem
   On Linux, `ActivitySubprocess.start()` previously used a bare `os.fork()`. 
If a background thread in the supervisor process (e.g. OTel exporter, 
google-auth refresh) held a C-level lock like OpenSSL's at the exact instant of 
the fork, the child inherited that lock in a perpetually locked state (since 
the thread holding it didn't survive the fork). Any subsequent attempt by the 
child to acquire the lock would deadlock indefinitely, causing tasks to hang.
   
   ### Solution
   This PR allows tasks to avoid the bare `os.fork()` on Linux by opting into 
the fork+exec path. It reuses the existing 
`core.execute_tasks_new_python_interpreter` configuration option.
   
   By setting `AIRFLOW__CORE__EXECUTE_TASKS_NEW_PYTHON_INTERPRETER=True`, 
`_should_use_exec()` will return `True` and execute tasks using a fresh 
interpreter that doesn't inherit the corrupted lock state. The default remains 
`False` to preserve existing performance where this issue is not encountered.
   
   Included an automated unit test asserting that `_should_use_exec()` 
correctly respects this configuration on Linux.


-- 
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]

Reply via email to