File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-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
@@ -134,6 +135,14 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
134
135
cr->SetCheckSource (command_endpoint->GetName ());
135
136
}
136
137
138
+ std::shared_lock producerLock (*cr->GetProducer (), std::try_to_lock);
139
+
140
+ if (!producerLock) {
141
+ // Discard the check result to not delay the current reload.
142
+ // We'll re-run the check immediately after the reload.
143
+ return Result::CheckableInactive;
144
+ }
145
+
137
146
/* agent checks go through the api */
138
147
if (command_endpoint && GetExtension (" agent_check" )) {
139
148
ApiListener::Ptr listener = ApiListener::GetInstance ();
Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ class CheckResult final : public ObjectImpl<CheckResult>
48
48
{
49
49
}
50
50
51
+ const CheckResultProducer::Ptr& GetProducer () const noexcept
52
+ {
53
+ return m_Producer;
54
+ }
55
+
51
56
double CalculateExecutionTime () const ;
52
57
double CalculateLatency () const ;
53
58
You can’t perform that action at this time.
0 commit comments