[icinga-checkins] icinga.org: icinga2/master: Fix: IDO marks objects as inactive on shutdown

git at icinga.org git at icinga.org
Wed Aug 17 19:33:47 CEST 2016


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Wed Aug 17 19:24:22 2016 +0200

Fix: IDO marks objects as inactive on shutdown

fixes #12418

---

 lib/base/application.cpp    |    5 +++++
 lib/base/application.hpp    |    2 ++
 lib/db_ido/dbconnection.cpp |    2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/base/application.cpp b/lib/base/application.cpp
index 1064106..712af5c 100644
--- a/lib/base/application.cpp
+++ b/lib/base/application.cpp
@@ -324,6 +324,11 @@ mainloop:
 	UninitializeBase();
 }
 
+bool Application::IsShuttingDown(void)
+{
+	return m_ShuttingDown;
+}
+
 void Application::OnShutdown(void)
 {
 	/* Nothing to do here. */
diff --git a/lib/base/application.hpp b/lib/base/application.hpp
index 9e5bb3d..b732378 100644
--- a/lib/base/application.hpp
+++ b/lib/base/application.hpp
@@ -73,6 +73,8 @@ public:
 	static void RequestRestart(void);
 	static void RequestReopenLogs(void);
 
+	static bool IsShuttingDown(void);
+
 	static void SetDebuggingSeverity(LogSeverity severity);
 	static LogSeverity GetDebuggingSeverity(void);
 
diff --git a/lib/db_ido/dbconnection.cpp b/lib/db_ido/dbconnection.cpp
index f07ba70..329c93b 100644
--- a/lib/db_ido/dbconnection.cpp
+++ b/lib/db_ido/dbconnection.cpp
@@ -430,7 +430,7 @@ bool DbConnection::GetStatusUpdate(const DbObject::Ptr& dbobj) const
 
 void DbConnection::UpdateObject(const ConfigObject::Ptr& object)
 {
-	if (!GetConnected())
+	if (!GetConnected() || Application::IsShuttingDown())
 		return;
 
 	DbObject::Ptr dbobj = DbObject::GetOrCreateByObject(object);



More information about the icinga-checkins mailing list