[icinga-checkins] icinga.org: icinga2/master: Fixed incorrect lock in Notification:: BeginExecuteNotificationHelper().

git at icinga.org git at icinga.org
Thu Feb 28 10:27:47 CET 2013


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Thu Feb 28 10:26:53 2013 +0100

Fixed incorrect lock in Notification::BeginExecuteNotificationHelper().

---

 lib/icinga/notification.cpp |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp
index a8a4e9e..3e2d493 100644
--- a/lib/icinga/notification.cpp
+++ b/lib/icinga/notification.cpp
@@ -196,6 +196,14 @@ void Notification::BeginExecuteNotification(const Notification::Ptr& self, Notif
 	}
 
 	BOOST_FOREACH(const User::Ptr& user, allUsers) {
+		String user_name;
+
+		{
+			ObjectLock olock(user);
+			user_name = user->GetName();
+		}
+
+		Logger::Write(LogDebug, "icinga", "Sending notification for user " + user_name);
 		BeginExecuteNotificationHelper(self, macros, type, user);
 	}
 
@@ -211,7 +219,7 @@ void Notification::BeginExecuteNotificationHelper(const Notification::Ptr& self,
 
 	if (user) {
 		{
-			ObjectLock olock(self);
+			ObjectLock olock(user);
 			macroDicts.push_back(user->GetMacros());
 		}
 





More information about the icinga-checkins mailing list