def update_failed_daemon_health_check(self) -> None:
failed_daemons = []
for dd in self.cache.get_error_daemons():
- if dd.daemon_type != 'agent': # agents tracked by CEPHADM_AGENT_DOWN
- failed_daemons.append('daemon %s on %s is in %s state' % (
- dd.name(), dd.hostname, dd.status_desc
- ))
+ if dd.daemon_type == 'agent': # agents tracked by CEPHADM_AGENT_DOWN
+ continue
+ assert dd.daemon_type is not None
+ svc_type = daemon_type_to_service(dd.daemon_type)
+ if (svc_type in ServiceSpec.REQUIRES_SERVICE_ID
+ and dd.service_name() in self.spec_store.spec_deleted):
+ # Service is being removed; daemon failure will be
+ # resolved by orphan cleanup. Don't raise a health
+ # alert that clears itself once removal completes.
+ continue
+ failed_daemons.append('daemon %s on %s is in %s state' % (
+ dd.name(), dd.hostname, dd.status_desc
+ ))
self.remove_health_warning('CEPHADM_FAILED_DAEMON')
if failed_daemons:
self.set_health_warning('CEPHADM_FAILED_DAEMON', f'{len(failed_daemons)} failed cephadm daemon(s)', len(