BashOperator Windows compatibility #41063
Labels
area:core
area:core-operators
Operators, Sensors and hooks within Core Airflow
kind:bug
This is a clearly a bug
Apache Airflow version
2.9.3
If "Other Airflow 2 version" selected, which one?
No response
What happened?
When attempting to run the simple tutorial from:
https://airflow.apache.org/docs/apache-airflow/stable/tutorial/fundamentals.html
on a Windows machine, there are two minor issues preventing this from working on Windows (related to #10388).
I resolved these issues locally and it seems to work on Windows now.
in airflow/hooks/subprocess.py line 77 in run_command() method:
fix
#1
: if running under Windows, setpreexec_fn=None
.fix
#2
: for Popen call, we also need to pass inclose_fds=True
. On Windows, the code as is, will result in a race condition where the sub_process has not fully released the directory created incwd = stack.enter_context(TemporaryDirectory(prefix="airflowtmp"))
, and we'll get an exception:What you think should happen instead?
BashOperator should work on Windows. Airflow 2.10 addresses a few other blocking issues.
How to reproduce
Running the simple tutorial at https://airflow.apache.org/docs/apache-airflow/stable/tutorial/fundamentals.html on a Windows box in Pycharm a few times will result in the exception.
Operating System
Windows 11
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else?
Race condition exception occurs 95% of the time when attempting to run the tutorial.
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: