vincbeck commented on code in PR #73222:
URL: https://github.com/apache/airflow/pull/73222#discussion_r4038607344


##########
airflow-core/src/airflow/api/common/airflow_health.py:
##########
@@ -78,14 +95,65 @@ def _dag_processor_instance_health(job: Job) -> dict[str, 
Any]:
     }
 
 
-def _aggregate_detailed_status(jobs: list[Job]) -> str:
-    """detailed_status: healthy (all alive), degraded (some alive), down (none 
alive)."""
-    alive_count = sum(1 for job in jobs if job.is_alive())
-    if alive_count == 0:
-        return DOWN
-    if alive_count == len(jobs):
+# ``detailed_status`` answers "is every part of this component's work being 
done", which needs a
+# denominator. Counting job rows cannot supply one: ``end_date`` is only 
written by a cooperative
+# shutdown, so a replica lost to SIGKILL, an OOM kill, or a node eviction 
leaves an unfinished row
+# behind forever and a restarted replica adds a second one. The denominator is 
therefore taken from
+# the declared work partition instead, which is unaffected by how replicas 
come and go:
+#
+# * Dag processor -- the bundles in ``[dag_processor] dag_bundle_config_list``.
+# * Triggerer -- the team scopes those bundles declare, since a triggerer only 
picks up triggers for
+#   its own team (see ``Trigger.ids_for_triggerer``).
+# * Scheduler -- schedulers are symmetric, so there is no partition and no 
partial state to report.
+
+
+def _configured_bundle_teams() -> dict[str, str | None]:
+    """Map every configured Dag bundle to the team owning it, empty when the 
config is unreadable."""
+    try:
+        return get_configured_bundle_team_names()

Review Comment:
   Good catch



-- 
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]

Reply via email to