File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed 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
@@ -106,6 +107,9 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
106107 if (!cr)
107108 return Result::NoCheckResult;
108109
110+ if (!producer)
111+ return Result::NoCheckResult;
112+
109113 double now = Utility::GetTime ();
110114
111115 if (cr->GetScheduleStart () == 0 )
@@ -134,6 +138,14 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
134138 cr->SetCheckSource (command_endpoint->GetName ());
135139 }
136140
141+ std::shared_lock producerLock (*producer, std::try_to_lock);
142+
143+ if (!producerLock) {
144+ // Discard the check result to not delay the current reload.
145+ // We'll re-run the check immediately after the reload.
146+ return Result::CheckableInactive;
147+ }
148+
137149 /* agent checks go through the api */
138150 if (command_endpoint && GetExtension (" agent_check" )) {
139151 ApiListener::Ptr listener = ApiListener::GetInstance ();
You can’t perform that action at this time.
0 commit comments