Skip to content

Conversation

@ashb
Copy link
Member

@ashb ashb commented Oct 24, 2025

This change is quite simple, as it simply calls the function added in #57212 if it's available. Up until the point that it is released this code will not hit the getattr will return None and be a no-op.

I didn't use the walrus operator here as theoretically someone could be using this to run in a Python that doesn't support it.

Fixes #51422, fixes #54706.

This doesn't have any unit tests, as a) it's relatively simple, and b) due to how we run in the same process in the tests, there is no socket to reconnect to, so we can't actually exercise this code

This change is quite simple, as it simply calls the function added in apache#57212
if it's available. Up until the point that it is released this code will not
hit the `getattr` will return None and be a no-op.

I didn't use the walrus operator here as _theoretically_ someone could be
using this to run in a Python that doesn't support it.

Fixes apache#51422, fixes apache#54706
Copy link
Member

@gopidesupavan gopidesupavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks yeah :)

Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thanks

@amoghrajesh
Copy link
Contributor

Pagerduty tests were fixed in main, rebase should help

@ashb ashb merged commit fb8b590 into apache:main Oct 28, 2025
114 checks passed
@ashb ashb deleted the log-var-and-conn-from-venv branch October 28, 2025 16:01
ashb pushed a commit that referenced this pull request Oct 29, 2025
…e 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.
sanju1198 pushed a commit to sanju1198/airflow that referenced this pull request Oct 29, 2025
…e 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 apache#57213) which allowed virtualenv code to access connections/variables and send logs via supervisor comms reinitialization.
Lzzz666 pushed a commit to Lzzz666/airflow that referenced this pull request Oct 30, 2025
…pache#57213)

This change is quite simple, as it simply calls the function added in apache#57212
if it's available. Up until the point that it is released this code will not
hit the `getattr` will return None and be a no-op.

I didn't use the walrus operator here as _theoretically_ someone could be
using this to run in a Python that doesn't support it.

Fixes apache#51422, fixes apache#54706

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
Lzzz666 pushed a commit to Lzzz666/airflow that referenced this pull request Oct 30, 2025
…e 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 apache#57213) which allowed virtualenv code to access connections/variables and send logs via supervisor comms reinitialization.
jscheffl pushed a commit that referenced this pull request Oct 31, 2025
…57497)

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

* Address review: Use built-in print as fallback

---------

Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Oct 31, 2025
… container (#57497)

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

* Address review: Use built-in print as fallback

---------
(cherry picked from commit 5002660)

Co-authored-by: Gurram Sai Ganesh <gurramsaiganesh93@gmail.com>
Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
jscheffl pushed a commit that referenced this pull request Oct 31, 2025
… container (#57497) (#57649)

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

* Address review: Use built-in print as fallback

---------
(cherry picked from commit 5002660)

Co-authored-by: Gurram Sai Ganesh <gurramsaiganesh93@gmail.com>
Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
ephraimbuddy pushed a commit that referenced this pull request Nov 3, 2025
… container (#57497) (#57649)

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

* Address review: Use built-in print as fallback

---------
(cherry picked from commit 5002660)

Co-authored-by: Gurram Sai Ganesh <gurramsaiganesh93@gmail.com>
Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
ephraimbuddy pushed a commit that referenced this pull request Nov 4, 2025
… container (#57497) (#57649)

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

* Address review: Use built-in print as fallback

---------
(cherry picked from commit 5002660)

Co-authored-by: Gurram Sai Ganesh <gurramsaiganesh93@gmail.com>
Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
…pache#57497)

* 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 apache#57213) which allowed virtualenv code to access connections/variables and send logs via supervisor comms reinitialization.

* Address review: Use built-in print as fallback

---------

Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@task.virtualenv doesn't show logs Couldn't able to access Airflow variables inside @task.virtualenv operator

4 participants