Uh oh!
There was an error while loading. Please reload this page.
Replace blocking IO with async IO in AsyncKubernetesHook - #35162
Conversation
hussein-awala
left a comment
There was a problem hiding this comment.
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?
functicons
commented
Oct 24, 2023
Thanks for the feedback! Could you give me some pointers on where to add the test? |
functicons
commented
Oct 24, 2023
Some checks failed with the following error: I'm not sure if it's caused by my change? Any help is appreciated! |
Taragolis
commented
Oct 24, 2023
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' |
Taragolis
commented
Oct 25, 2023
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? |
potiuk
commented
Oct 26, 2023
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. |
potiuk
commented
Oct 26, 2023
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 :). |
potiuk
commented
Oct 26, 2023
Fixed in main. I rebased to see if it helps |
potiuk
commented
Oct 26, 2023
It does :) |
hussein-awala
commented
Oct 26, 2023
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.rstor{issue_number}.significant.rst, in newsfragments.