File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414#include " base/convert.hpp"
1515#include " base/utility.hpp"
1616#include " base/context.hpp"
17+ #include < shared_mutex>
1718
1819using namespace icinga ;
1920
@@ -101,6 +102,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
101102 using Result = Checkable::ProcessingResult;
102103
103104 VERIFY (cr);
105+ VERIFY (producer);
104106
105107 {
106108 ObjectLock olock (this );
@@ -135,6 +137,14 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
135137 cr->SetCheckSource (command_endpoint->GetName ());
136138 }
137139
140+ std::shared_lock producerLock (*producer, std::try_to_lock);
141+
142+ if (!producerLock) {
143+ // Discard the check result to not delay the current reload.
144+ // We'll re-run the check immediately after the reload.
145+ return Result::CheckableInactive;
146+ }
147+
138148 /* agent checks go through the api */
139149 if (command_endpoint && GetExtension (" agent_check" )) {
140150 ApiListener::Ptr listener = ApiListener::GetInstance ();
You can’t perform that action at this time.
0 commit comments