Skip to content
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

refactor: Make sure xcoms work correctly in MSGraphAsyncOperator with concurrent workers #40297

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

dabla
Copy link
Contributor

@dabla dabla commented Jun 18, 2024

This pull request makes sure xcoms work correctly in a multi-threaded environment (e.g. when applying dynamic task mapping with concurrent workers) by taking the map_index into account when pushing and pulling xcoms.


^ Add meaningful description above
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.

@dabla dabla changed the title refactor: Make sure xcoms work correctly with MSGraphAsyncOperator with concurrent workers refactor: Make sure xcoms work correctly in MSGraphAsyncOperator with concurrent workers Jun 18, 2024
@potiuk
Copy link
Member

potiuk commented Jun 18, 2024

Is it possible to add unit test for that to avoid regressions ?

@dabla
Copy link
Contributor Author

dabla commented Jun 18, 2024

Is it possible to add unit test for that to avoid regressions ?

That would mean a unit test using multiple threads as I need concurrency to reproduce it. Are there any examples of unit tests using multiple threads?

@potiuk
Copy link
Member

potiuk commented Jun 18, 2024

That would mean a unit test using multiple threads as I need concurrency to reproduce it. Are there any examples of unit tests using multiple threads?

When I search in tests there are at least few Thread( usages 😄

@dabla
Copy link
Contributor Author

dabla commented Jun 18, 2024

That would mean a unit test using multiple threads as I need concurrency to reproduce it. Are there any examples of unit tests using multiple threads?

When I search in tests there are at least few Thread( usages 😄

Ok will also search then, I just asked because I know from experience that test with threads can something mess up the whole test pipeline

@dabla
Copy link
Contributor Author

dabla commented Jun 18, 2024

The problem with Python is that the basic threading doesn't do real multithreading, so I don't know if I will be able to reproduce it as we did encounter the issues with multiple workers being deployed across multiple pods. So in order to test this correctly, I would be force to use the multiprocessing pyhton module.

@potiuk
Copy link
Member

potiuk commented Jun 18, 2024

The problem with Python is that the basic threading doesn't do real multithreading, so I don't know if I will be able to reproduce it as we did encounter the issues with multiple workers being deployed across multiple pods. So in order to test this correctly, I would be force to use the multiprocessing pyhton module.

Yeah. If it's too much of a hassle and reproducibility is difficult, then yeah we can definitely skip tests

@potiuk potiuk merged commit 9b394a7 into apache:main Jun 18, 2024
51 checks passed
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
…t by taking the map_index into account (apache#40297)

Co-authored-by: David Blain <[email protected]>
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.

3 participants