its-amann commented on code in PR #76559:
URL: https://github.com/apache/airflow/pull/76559#discussion_r4502802162
##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -1367,13 +1373,17 @@ def _refresh_dag_bundles(self, known_files: dict[str,
set[DagFileInfo]]):
# Keep the bundle's known files and Dags, and leave its
version unadvanced so the
# next refresh lists it again.
self.log.exception("Error listing Dag definitions in
bundle %s", bundle.name)
+ if self.api_client is None:
+ self._record_bundle_refresh_error(bundle.name,
traceback.format_exc())
Review Comment:
after a listing failure the version stays put on purpose, so the next
refresh hits the version short circuit, clears this import error, and never
lists again. drop the bundle from `_bundle_versions` here so the short circuit
cannot fire until listing succeeds.
```suggestion
self._record_bundle_refresh_error(bundle.name,
traceback.format_exc())
# Listing failed and the version was left
unadvanced. Drop the
# cached version so the short circuit below cannot
clear this
# error and skip listing on the next refresh.
self._bundle_versions.pop(bundle.name, None)
```
pushed it with the test tweak here if you want to cherry pick:
https://github.com/its-amann/airflow/commit/223ea625d42e56ad019c3753bf260b33997ed975
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]