mirror of https://github.com/Icinga/icinga2.git
Merge pull request #10011 from Icinga/next-check-cluster-sync-issue
Checkable: Don't recalculate `next_check` for remotely generated `cr`
This commit is contained in:
commit
4c6b93d617
|
@ -360,8 +360,14 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
||||||
|
|
||||||
bool is_flapping = IsFlapping();
|
bool is_flapping = IsFlapping();
|
||||||
|
|
||||||
|
// Don't recompute the next check when the current check isn't generated by this endpoint. When the check is
|
||||||
|
// remotely generated we should've already received the "SetNextCheck" event before the "event::CheckResult"
|
||||||
|
// cluster event. Otherwise, the next check received before this check will be invalidated and cause the Checkable
|
||||||
|
// "next_check/next_update" in a HA setup to always be different from the other endpoint as the "m_SchedulingOffset"
|
||||||
|
// is randomly initialised on each node.
|
||||||
|
if (!origin) {
|
||||||
if (cr->GetActive()) {
|
if (cr->GetActive()) {
|
||||||
UpdateNextCheck(origin);
|
UpdateNextCheck();
|
||||||
} else {
|
} else {
|
||||||
/* Reschedule the next check for external passive check results. The side effect of
|
/* Reschedule the next check for external passive check results. The side effect of
|
||||||
* this is that for as long as we receive results for a service we
|
* this is that for as long as we receive results for a service we
|
||||||
|
@ -374,7 +380,8 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
||||||
else
|
else
|
||||||
offset = GetCheckInterval();
|
offset = GetCheckInterval();
|
||||||
|
|
||||||
SetNextCheck(Utility::GetTime() + offset, false, origin);
|
SetNextCheck(Utility::GetTime() + offset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
olock.Unlock();
|
olock.Unlock();
|
||||||
|
|
Loading…
Reference in New Issue