From: Michael Friedrich Date: Tue, 30 Oct 2018 12:17:28 +0000 (+0100) Subject: DB IDO: Don't enqueue queries when the feature is paused (HA) X-Git-Tag: v2.11.0-rc1~307^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F6740%2Fhead;p=icinga2 DB IDO: Don't enqueue queries when the feature is paused (HA) fixes #5876 refs #6739 --- diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp index 1a13b89cc..9bbbeb0df 100644 --- a/lib/db_ido_mysql/idomysqlconnection.cpp +++ b/lib/db_ido_mysql/idomysqlconnection.cpp @@ -162,6 +162,9 @@ void IdoMysqlConnection::TxTimerHandler() void IdoMysqlConnection::NewTransaction() { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling new transaction and finishing async queries."; @@ -715,6 +718,9 @@ void IdoMysqlConnection::DiscardRows(const IdoMysqlResult& result) void IdoMysqlConnection::ActivateObject(const DbObject::Ptr& dbobj) { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling object activation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'."; @@ -727,6 +733,9 @@ void IdoMysqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj) { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -754,6 +763,9 @@ void IdoMysqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj) void IdoMysqlConnection::DeactivateObject(const DbObject::Ptr& dbobj) { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling object deactivation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'."; @@ -766,6 +778,9 @@ void IdoMysqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj) { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -855,6 +870,9 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va void IdoMysqlConnection::ExecuteQuery(const DbQuery& query) { + if (IsPaused()) + return; + ASSERT(query.Category != DbCatInvalid); #ifdef I2_DEBUG /* I2_DEBUG */ @@ -867,6 +885,9 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query) void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector& queries) { + if (IsPaused()) + return; + if (queries.empty()) return; @@ -914,6 +935,9 @@ void IdoMysqlConnection::InternalExecuteMultipleQueries(const std::vector& queries) { + if (IsPaused()) + return; + if (queries.empty()) return; @@ -748,6 +763,9 @@ void IdoPgsqlConnection::InternalExecuteMultipleQueries(const std::vector