-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(broker): if errno==0, we considerer the error as a server error
- Loading branch information
Showing
3 changed files
with
212 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
* For more information : [email protected] | ||
*/ | ||
#include <errmsg.h> | ||
#include <mysqld_error.h> | ||
|
||
#include "com/centreon/broker/config/applier/init.hh" | ||
#include "com/centreon/broker/misc/misc.hh" | ||
|
@@ -462,10 +463,10 @@ void mysql_connection::_statement(mysql_task* t) { | |
if (mysql_stmt_execute(stmt)) { | ||
int32_t err_code = ::mysql_stmt_errno(stmt); | ||
if (err_code == 0) { | ||
SPDLOG_LOGGER_TRACE( | ||
_logger, | ||
"mysql_connection: errno=0, so we simulate a server error 1213"); | ||
err_code = 1213; | ||
SPDLOG_LOGGER_TRACE(_logger, | ||
"mysql_connection: errno=0, so we simulate a " | ||
"server error CR_SERVER_LOST"); | ||
err_code = CR_SERVER_LOST; | ||
} | ||
std::string err_msg(fmt::format("{} errno={} {}", | ||
mysql_error::msg[task->error_code], | ||
|
@@ -477,8 +478,8 @@ void mysql_connection::_statement(mysql_task* t) { | |
set_error_message(err_msg); | ||
break; | ||
} | ||
if (mysql_stmt_errno(stmt) != 1213 && | ||
mysql_stmt_errno(stmt) != 1205) // Dead Lock error | ||
if (err_code != ER_LOCK_DEADLOCK && | ||
err_code != ER_LOCK_WAIT_TIMEOUT) // Dead Lock error | ||
attempts = MAX_ATTEMPTS; | ||
|
||
if (mysql_commit(_conn)) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e124d9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Failed Tests
Rrd-From-Db
Rrd-From-Db
Rrd-From-Db
Rrd
Rrd
Rrdcached-From-Db
Rrdcached-From-Db
Rrdcached
Rrdcached
e124d9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Failed Tests
Rrd-From-Db
Rrd-From-Db
Rrd-From-Db
Rrd
Rrd
Rrdcached-From-Db
Rrdcached-From-Db
Rrdcached
Rrdcached
Services-And-Bulk-Stmt
e124d9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Failed Tests
Rrd-From-Db
Rrd-From-Db
Rrd-From-Db
Rrd
Rrd
Rrdcached-From-Db
Rrdcached-From-Db
Rrdcached
Rrdcached
e124d9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Failed Tests
Hostgroups
Rrd-From-Db
Rrd-From-Db
Rrd-From-Db
Rrd-From-Db
Rrd-From-Db
Rrd-From-Db
Rrd
Rrd
Rrd
Rrd
Rrdcached-From-Db
Rrdcached-From-Db
Rrdcached-From-Db
Rrdcached-From-Db
Rrdcached
Rrdcached
Rrdcached
Rrdcached
Services-And-Bulk-Stmt
Services-And-Bulk-Stmt
e124d9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Failed Tests
Notifications
Rrd-From-Db
Rrd-From-Db
Rrd-From-Db
Rrd
Rrd
Rrdcached-From-Db
Rrdcached-From-Db
Rrdcached
Rrdcached
Services-And-Bulk-Stmt