mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-26 02:58:43 +02:00
Log can't-do-yets
This commit is contained in:
parent
10b3bacb48
commit
eddb4beea0
@ -488,6 +488,8 @@ void IdoMysqlConnection::FinishConnect(double startTime)
|
|||||||
|
|
||||||
Query("COMMIT");
|
Query("COMMIT");
|
||||||
Query("BEGIN");
|
Query("BEGIN");
|
||||||
|
|
||||||
|
m_Reconnected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdoMysqlConnection::ClearTablesBySession()
|
void IdoMysqlConnection::ClearTablesBySession()
|
||||||
@ -1016,12 +1018,10 @@ void IdoMysqlConnection::InternalExecuteMultipleQueries(const std::vector<DbQuer
|
|||||||
ASSERT(query.Type == DbQueryNewTransaction || query.Category != DbCatInvalid);
|
ASSERT(query.Type == DbQueryNewTransaction || query.Category != DbCatInvalid);
|
||||||
|
|
||||||
if (!CanExecuteQuery(query)) {
|
if (!CanExecuteQuery(query)) {
|
||||||
|
if (m_Reconnected && query.Table != "contactnotifications")
|
||||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
Log(LogDebug, "IdoMysqlConnectionDebug")
|
||||||
Log(LogDebug, "IdoMysqlConnection")
|
|
||||||
<< "Scheduling multiple execute query task again: Cannot execute query now. Type '"
|
<< "Scheduling multiple execute query task again: Cannot execute query now. Type '"
|
||||||
<< query.Type << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
<< query.Type << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
||||||
#endif /* I2_DEBUG */
|
|
||||||
|
|
||||||
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteMultipleQueries, this, queries), query.Priority);
|
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteMultipleQueries, this, queries), query.Priority);
|
||||||
return;
|
return;
|
||||||
@ -1066,12 +1066,10 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
|
|
||||||
/* check if there are missing object/insert ids and re-enqueue the query */
|
/* check if there are missing object/insert ids and re-enqueue the query */
|
||||||
if (!CanExecuteQuery(query)) {
|
if (!CanExecuteQuery(query)) {
|
||||||
|
if (m_Reconnected && query.Table != "contactnotifications")
|
||||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
Log(LogDebug, "IdoMysqlConnectionDebug")
|
||||||
Log(LogDebug, "IdoMysqlConnection")
|
|
||||||
<< "Scheduling execute query task again: Cannot execute query now. Type '"
|
<< "Scheduling execute query task again: Cannot execute query now. Type '"
|
||||||
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
||||||
#endif /* I2_DEBUG */
|
|
||||||
|
|
||||||
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
|
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
|
||||||
return;
|
return;
|
||||||
@ -1089,12 +1087,10 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
|
|
||||||
for (const Dictionary::Pair& kv : query.WhereCriteria) {
|
for (const Dictionary::Pair& kv : query.WhereCriteria) {
|
||||||
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
||||||
|
if (m_Reconnected && query.Table != "contactnotifications")
|
||||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
Log(LogDebug, "IdoMysqlConnectionDebug")
|
||||||
Log(LogDebug, "IdoMysqlConnection")
|
|
||||||
<< "Scheduling execute query task again: Cannot execute query now. Type '"
|
<< "Scheduling execute query task again: Cannot execute query now. Type '"
|
||||||
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
||||||
#endif /* I2_DEBUG */
|
|
||||||
|
|
||||||
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
|
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
|
||||||
return;
|
return;
|
||||||
@ -1169,12 +1165,10 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
||||||
|
if (m_Reconnected && query.Table != "contactnotifications")
|
||||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
Log(LogDebug, "IdoMysqlConnectionDebug")
|
||||||
Log(LogDebug, "IdoMysqlConnection")
|
|
||||||
<< "Scheduling execute query task again: Cannot extract required INSERT/UPDATE fields, key '"
|
<< "Scheduling execute query task again: Cannot extract required INSERT/UPDATE fields, key '"
|
||||||
<< kv.first << "', val '" << kv.second << "', type " << typeOverride << ", table '" << query.Table << "'.";
|
<< kv.first << "', val '" << kv.second << "', type " << typeOverride << ", table '" << query.Table << "'.";
|
||||||
#endif /* I2_DEBUG */
|
|
||||||
|
|
||||||
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
|
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
|
||||||
return;
|
return;
|
||||||
|
@ -64,6 +64,7 @@ private:
|
|||||||
|
|
||||||
std::vector<IdoAsyncQuery> m_AsyncQueries;
|
std::vector<IdoAsyncQuery> m_AsyncQueries;
|
||||||
uint_fast32_t m_UncommittedAsyncQueries = 0;
|
uint_fast32_t m_UncommittedAsyncQueries = 0;
|
||||||
|
bool m_Reconnected = false;
|
||||||
|
|
||||||
Timer::Ptr m_ReconnectTimer;
|
Timer::Ptr m_ReconnectTimer;
|
||||||
Timer::Ptr m_TxTimer;
|
Timer::Ptr m_TxTimer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user