From: Sage Weil Date: Wed, 31 Jul 2019 05:19:39 +0000 (-0500) Subject: mon/HealthMonitor: automatically clear non-sticky mutes when alert clears X-Git-Tag: v15.1.0~1877^2~18 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=70db3f025a02b599522a1b78157ae99d7208f889;p=ceph-ci.git mon/HealthMonitor: automatically clear non-sticky mutes when alert clears If the alert goes away, drop the mute. Signed-off-by: Sage Weil --- diff --git a/src/mon/HealthMonitor.cc b/src/mon/HealthMonitor.cc index b028adb8afb..3f8ed8f9ab5 100644 --- a/src/mon/HealthMonitor.cc +++ b/src/mon/HealthMonitor.cc @@ -364,6 +364,8 @@ bool HealthMonitor::check_mutes() { bool changed = true; auto now = ceph_clock_now(); + health_check_map_t all; + gather_all_health_checks(&all); auto p = pending_mutes.begin(); while (p != pending_mutes.end()) { if (p->second.ttl != utime_t() && @@ -372,6 +374,12 @@ bool HealthMonitor::check_mutes() << " cleared (passed TTL " << p->second.ttl << ")"; p = pending_mutes.erase(p); changed = true; + } else if (!p->second.sticky && + all.checks.count(p->first) == 0) { + mon->clog->info() << "Health alert mute " << p->first + << " cleared (health alert cleared)"; + p = pending_mutes.erase(p); + changed = true; } else { ++p; }