Prevent FileNotFoundError in deserialize_value of XCom io provider to crash the scheduler #52702
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some rare race conditions, it happens that an XCom which is stored on a local file system can't be found and raises a FileNotFoundError in the XCom io provider backend. When this exception is raised, it actually crashes the scheduler, which is not good as this means the scheduler is down until it's restarted, the task should fail but the scheduler shouldn't crash because of it. In attachment the airflow-xcom-log-trace.txt of the scheduler with the stacktrace. This PR makes sure the exception isn't propagated to the scheduler, I've also added a test case for it in the backend provider.
^ 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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.