[icinga-checkins] icinga.org: icinga2/master: Fixed infinite loop bug in Service:: BeginExecuteCheck.

git at icinga.org git at icinga.org
Fri Feb 8 11:24:05 CET 2013


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Feb  8 11:22:42 2013 +0100

Fixed infinite loop bug in Service::BeginExecuteCheck.

---

 lib/icinga/service.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp
index ea01284..260fd95 100644
--- a/lib/icinga/service.cpp
+++ b/lib/icinga/service.cpp
@@ -661,7 +661,9 @@ void Service::BeginExecuteCheck(const function<void (void)>& callback)
 		arguments.push_back(static_cast<Service::Ptr>(GetSelf()));
 		ScriptTask::Ptr task;
 		task = InvokeMethod("check", arguments, boost::bind(&Service::CheckCompletedHandler, this, scheduleInfo, _1, callback));
-		Set("current_task", task);
+
+		if (!task->IsFinished())
+			Set("current_task", task);
 	} catch (...) {
 		/* something went wrong while setting up the method call -
 		 * reschedule the service and call the callback anyway. */





More information about the icinga-checkins mailing list