mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +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/utility.hpp"
|
||||
#include "base/context.hpp"
|
||||
#include <shared_mutex>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -101,6 +102,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
||||
using Result = Checkable::ProcessingResult;
|
||||
|
||||
VERIFY(cr);
|
||||
VERIFY(producer);
|
||||
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
@ -135,6 +137,14 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
||||
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 */
|
||||
if (command_endpoint && GetExtension("agent_check")) {
|
||||
ApiListener::Ptr listener = ApiListener::GetInstance();
|
||||
|
Loading…
x
Reference in New Issue
Block a user