-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Fixed thread local _sentinel.callers defect and added test cases #44646
Fixed thread local _sentinel.callers defect and added test cases #44646
Conversation
Please add a meaningful description to this pr, and likely unit tests too |
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.
PFA
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.
PFA
Is there a reason why this PR isn't merged yet as it fixes a thread safety issues with the ExecutorSafeguard? |
I thi k we mostly overlooked it :( |
…che#44646) * Update base.py * Update base.py * Update base.py * Update baseoperator.py * Update base.py * Update base.py * Update baseoperator.py * Update baseoperator.py * Fixed thread local _sentinel.callers defect and added test cases * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue --------- Co-authored-by: Rahul Goyal <[email protected]>
…che#44646) * Update base.py * Update base.py * Update base.py * Update baseoperator.py * Update base.py * Update base.py * Update baseoperator.py * Update baseoperator.py * Fixed thread local _sentinel.callers defect and added test cases * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue --------- Co-authored-by: Rahul Goyal <[email protected]>
What is the target release version for this fix? |
Currently Airflow 3. Why? Is this worthwhile to make an attempt to backport it to Airflow 2.* ? If so - why? What would be your arguments @kulkarni-sp ? |
We are currently using Airflow 2.9.3 and encountered the same errors during our attempt to upgrade to 2.10.3. Therefore, this fix is essential to unblock our upgrade path. |
Could you please be more specific - what exactly error you experienced - i think that one has no clear issue that it marks as "solving" ? And is it possible that you apply that patch to verify that this one solves it ? |
We are utilizing Airflow with KubernetesExecutor and have several long-running pods that continuously monitor specified locations for input files. Initially, we used mapped tasks to specify different input locations, but this led to a higher number of pods and caused stability issues on our AKS cluster. Now, we are employing ThreadPoolExecutor for parallel processing, which triggers the processor DAG upon receiving a valid input file. However, with Airflow 2.10.3, we encounter the following errors when triggering the processor DAG: [2025-01-10, 12:53:29 UTC] {ThreadPoolExecutor-1_3 logging_mixin.py:190} INFO - pa: Error while calling processor DAG: '_thread._local' object has no attribute 'callers'
|
@potiuk We have also applied this patch, Requires minor change for it to work in multithreaded env i.e. getattr check and initialization should be done before sentinel check OR It could work with this PR https://github.com/apache/airflow/pull/44240/files
|
I guess this issue fixes #44648 which is a bug on 2.10.3 |
I marked it as 2.10.5 milestone to not forget about it. |
@utkarsharma2 Is it possible for you to include this make minor change? Essentially doing getattr check before if statement. |
…che#44646) * Update base.py * Update base.py * Update base.py * Update baseoperator.py * Update base.py * Update base.py * Update baseoperator.py * Update baseoperator.py * Fixed thread local _sentinel.callers defect and added test cases * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue --------- Co-authored-by: Rahul Goyal <[email protected]> (cherry picked from commit a77fca2)
…che#44646) * Update base.py * Update base.py * Update base.py * Update baseoperator.py * Update base.py * Update base.py * Update baseoperator.py * Update baseoperator.py * Fixed thread local _sentinel.callers defect and added test cases * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue --------- Co-authored-by: Rahul Goyal <[email protected]>
) (#46280) * Update base.py * Update base.py * Update base.py * Update baseoperator.py * Update base.py * Update base.py * Update baseoperator.py * Update baseoperator.py * Fixed thread local _sentinel.callers defect and added test cases * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue * Fixed issue --------- Co-authored-by: Rahul Goyal <[email protected]> (cherry picked from commit a77fca2) Co-authored-by: rahulgoyal2987 <[email protected]>
^ 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.