andreahlert commented on code in PR #61629:
URL: https://github.com/apache/airflow/pull/61629#discussion_r2779643694


##########
providers/standard/src/airflow/providers/standard/operators/python.py:
##########
@@ -637,6 +637,20 @@ def _execute_python_callable_in_subprocess(self, 
python_path: Path):
             env_vars = dict(os.environ) if self.inherit_env else {}
             if fd := os.getenv("__AIRFLOW_SUPERVISOR_FD"):
                 env_vars["__AIRFLOW_SUPERVISOR_FD"] = fd
+            elif AIRFLOW_V_3_0_PLUS and "__AIRFLOW_SUPERVISOR_FD" not in 
env_vars:

Review Comment:
   Normal forked execution. The supervisor dup2's the comms socket onto fd 0 
never sets __AIRFLOW_SUPERVISOR_FD in env. So when the virtualenv operator 
spawns a Popen on top of that, getenv returns None and we land here.
   
   We grab the fd from the existing SUPERVISOR_COMMS and pass it through. 
Otherwise reinit in the child defaults to fd 0 which is stdout at that point 
because Popen redirected it.



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