-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace blocking IO with async IO in AsyncKubernetesHook #35162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this needs to be improved, I tried to implement a similar solution in the past but I had a problem with an older version of aiofiles, could you add a unit test fo this to check if it works as expected?
Thanks for the feedback! Could you give me some pointers on where to add the test? |
Some checks failed with the following error:
I'm not sure if it's caused by my change? Any help is appreciated! |
I guess this related to changes in #35099 WARNING: apache-airflow 2.7.2 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 2.7.1 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 2.7.0 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 2.6.3 does not provide the extra 'cncf-kubernetes'
...
WARNING: apache-airflow 1.10.9 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 1.10.8 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 1.10.7 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 1.10.6 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 1.10.5 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 1.10.4 does not provide the extra 'cncf-kubernetes'
WARNING: apache-airflow 1.10.3 does not provide the extra 'cncf-kubernetes' |
I've checked again, previous error happen because we tried to install Airflow from PyPI with constraints for main branch. And actual error happen in tests
I would recommend to add Jarek @potiuk maybe you know how to deal with new dependencies for K8S Provider in tests without add it into ci requirements? |
Hmm. This is an interesting one. The change to use I will make a small PR to improve it and ask you to rebase @functicons affter it's merged. |
OK. I think I figured out exactly what was going on and have a fix in #35191 that should work in all cases. The change I implemented to make #34729 work with the new pre-installed While looking at it closely I also found out that #35099 change was not really good for implementing changes to KPO (we did not test the local version of it but the released one) but also that the original way it has been implemented, also had the side effect that local testing while modifying KPO was not really using the modified version either. The #35191 should kill all those birds with single stone. Not good it happened, here, but good it got my attention to those problems :). |
Fixed in main. I rebased to see if it helps |
It does :) |
My problem was with the CI image too, I thought it was a conflict issue. For the change, I'm using a similar solution in my operators without any issues, so it's safe to merge this one. |
Currently there are blocking IO operations in AsyncKubernetesHook, which are causing triggerer failures or high CPU usage. This change replaces them with async IO.
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.