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

git at icinga.org git at icinga.org
Tue Aug 30 13:58:53 CEST 2016


Module: icinga2
Branch: support/2.5
Commit: 8f7b819c9d48ca1c490c87afd6541bf0b304370f
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=8f7b819c9d48ca1c490c87afd6541bf0b304370f

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 3f5d2d1..880ea06 100644
--- a/lib/checker/checkercomponent.cpp
+++ b/lib/checker/checkercomponent.cpp
@@ -194,6 +194,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();
@@ -222,6 +224,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