File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 14
14
#include " base/convert.hpp"
15
15
#include " base/utility.hpp"
16
16
#include " base/context.hpp"
17
+ #include < shared_mutex>
17
18
18
19
using namespace icinga ;
19
20
@@ -106,6 +107,9 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
106
107
if (!cr)
107
108
return Result::NoCheckResult;
108
109
110
+ if (!producer)
111
+ return Result::NoCheckResult;
112
+
109
113
double now = Utility::GetTime ();
110
114
111
115
if (cr->GetScheduleStart () == 0 )
@@ -134,6 +138,14 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
134
138
cr->SetCheckSource (command_endpoint->GetName ());
135
139
}
136
140
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
+
137
149
/* agent checks go through the api */
138
150
if (command_endpoint && GetExtension (" agent_check" )) {
139
151
ApiListener::Ptr listener = ApiListener::GetInstance ();
You can’t perform that action at this time.
0 commit comments