You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2025/10/29 09:54:36 UTC
(airflow) branch main updated: Revert virtualenv connections/variables access and logging as test are failing
This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 84e95b65f5b Revert virtualenv connections/variables access and logging as test are failing
84e95b65f5b is described below
commit 84e95b65f5b6f118be5c563be31990bdc520383b
Author: Ankit Chaurasia <86...@users.noreply.github.com>
AuthorDate: Wed Oct 29 15:39:29 2025 +0545
Revert virtualenv connections/variables access and logging as test are failing
Revert virtualenv connections/variables access and logging as tests are failing in https://github.com/apache/airflow/actions/runs/18896380254. The issue here is that it's a socket initialisation error that occurs when CommsDecoder tries to create a socket from stdin (file descriptor 0) in subprocess environments where stdin is not a socket.
This reverts commit fb8b590 (PR #57213) which allowed virtualenv code to access connections/variables and send logs via supervisor comms reinitialization.
---
.../standard/utils/python_virtualenv_script.jinja2 | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/providers/standard/src/airflow/providers/standard/utils/python_virtualenv_script.jinja2 b/providers/standard/src/airflow/providers/standard/utils/python_virtualenv_script.jinja2
index 860be22bef9..cb4b738138f 100644
--- a/providers/standard/src/airflow/providers/standard/utils/python_virtualenv_script.jinja2
+++ b/providers/standard/src/airflow/providers/standard/utils/python_virtualenv_script.jinja2
@@ -38,16 +38,6 @@ if sys.version_info >= (3,6):
{# Airflow is not available in this environment, therefore we won't
# be able to integrate any plugin macros. #}
pass
-
-try:
- from airflow.sdk.execution_time import task_runner
-except ModuleNotFoundError:
- pass
-else:
- {#- We are in an Airflow 3.x env, try and set up supervisor comms so virtual env can still access tasks etc! #}
- reinit_supervisor_comms = getattr(task_runner, "reinit_supervisor_comms", None)
- if reinit_supervisor_comms:
- reinit_supervisor_comms()
{% endif %}
# Script
@@ -59,10 +49,12 @@ else:
import types
{{ modified_dag_module_name }} = types.ModuleType("{{ modified_dag_module_name }}")
+
{{ modified_dag_module_name }}.{{ python_callable }} = {{ python_callable }}
+
sys.modules["{{modified_dag_module_name}}"] = {{modified_dag_module_name}}
-{%- endif -%}
+{% endif%}
{% if op_args or op_kwargs %}
with open(sys.argv[1], "rb") as file: