File tree 1 file changed +10
-0
lines changed
1 file changed +10
-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
@@ -101,6 +102,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
101
102
using Result = Checkable::ProcessingResult;
102
103
103
104
VERIFY (cr);
105
+ VERIFY (producer);
104
106
105
107
{
106
108
ObjectLock olock (this );
@@ -135,6 +137,14 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
135
137
cr->SetCheckSource (command_endpoint->GetName ());
136
138
}
137
139
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
+
138
148
/* agent checks go through the api */
139
149
if (command_endpoint && GetExtension (" agent_check" )) {
140
150
ApiListener::Ptr listener = ApiListener::GetInstance ();
You can’t perform that action at this time.
0 commit comments