mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 14:44:32 +02:00
Checkable#ProcessCheckResult(): discard CR or delay its producers shutdown
This commit is contained in:
parent
f4691dd054
commit
36743f3100
@ -14,6 +14,7 @@
|
|||||||
#include "base/convert.hpp"
|
#include "base/convert.hpp"
|
||||||
#include "base/utility.hpp"
|
#include "base/utility.hpp"
|
||||||
#include "base/context.hpp"
|
#include "base/context.hpp"
|
||||||
|
#include <shared_mutex>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
@ -101,6 +102,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||||||
using Result = Checkable::ProcessingResult;
|
using Result = Checkable::ProcessingResult;
|
||||||
|
|
||||||
VERIFY(cr);
|
VERIFY(cr);
|
||||||
|
VERIFY(producer);
|
||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(this);
|
ObjectLock olock(this);
|
||||||
@ -135,6 +137,14 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||||||
cr->SetCheckSource(command_endpoint->GetName());
|
cr->SetCheckSource(command_endpoint->GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_lock producerLock (*producer, std::try_to_lock);
|
||||||
|
|
||||||
|
if (!producerLock) {
|
||||||
|
// Discard the check result to not delay the current reload.
|
||||||
|
// We'll re-run the check immediately after the reload.
|
||||||
|
return Result::CheckableInactive;
|
||||||
|
}
|
||||||
|
|
||||||
/* agent checks go through the api */
|
/* agent checks go through the api */
|
||||||
if (command_endpoint && GetExtension("agent_check")) {
|
if (command_endpoint && GetExtension("agent_check")) {
|
||||||
ApiListener::Ptr listener = ApiListener::GetInstance();
|
ApiListener::Ptr listener = ApiListener::GetInstance();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user