[icinga-checkins] icinga.org: icinga2/master: Fix race condition for concurrent_checks

git at icinga.org git at icinga.org
Mon Aug 29 14:13:05 CEST 2016


Module: icinga2
Branch: master
Commit: 3d1490529fcd18aadfa6748cceb75ff907fc6599
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=3d1490529fcd18aadfa6748cceb75ff907fc6599

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Mon Aug 29 14:12:29 2016 +0200

Fix race condition for concurrent_checks

fixes #11932

---

 lib/checker/checkercomponent.cpp |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/checker/checkercomponent.cpp b/lib/checker/checkercomponent.cpp
index ac8da33..89cb45b 100644
--- a/lib/checker/checkercomponent.cpp
+++ b/lib/checker/checkercomponent.cpp
@@ -193,6 +193,8 @@ void CheckerComponent::CheckThreadProc(void)
 		Log(LogDebug, "CheckerComponent")
 		    << "Executing check for '" << checkable->GetName() << "'";
 
+		Checkable::IncreasePendingChecks();
+
 		Utility::QueueAsyncCallback(boost::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable));
 
 		lock.lock();
@@ -221,6 +223,8 @@ void CheckerComponent::ExecuteCheckHelper(const Checkable::Ptr& checkable)
 		Log(LogCritical, "checker", output);
 	}
 
+	Checkable::DecreasePendingChecks();
+
 	{
 		boost::mutex::scoped_lock lock(m_Mutex);
 



More information about the icinga-checkins mailing list