]> granicus.if.org Git - icinga2/commitdiff
Fix race condition for concurrent_checks
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 29 Aug 2016 12:12:29 +0000 (14:12 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Tue, 30 Aug 2016 11:58:39 +0000 (13:58 +0200)
fixes #11932

lib/checker/checkercomponent.cpp

index 3f5d2d1120985228b0d331898d26006502a1018e..880ea06ba37740da8e362886ae4b6f6e4b66cc54 100644 (file)
@@ -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);