From: Razvan Becheriu Date: Thu, 3 Oct 2024 12:08:50 +0000 (+0300) Subject: [#3536] removed more duplicated messages X-Git-Tag: Kea-2.7.4~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6dbb732fadfdf5ef3370eabf7dd6644263153e15;p=thirdparty%2Fkea.git [#3536] removed more duplicated messages --- diff --git a/src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc b/src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc index fc5bb0df99..3ab91e1d31 100644 --- a/src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc +++ b/src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc @@ -2902,6 +2902,7 @@ public: } bool reopened = false; + bool do_exit = false; const std::string timer_name = db_reconnect_ctl->timerName(); @@ -2913,10 +2914,8 @@ public: // Something is definitely wrong. Did the configuration change // somehow and there is no configuration for CB? if (!config_ctl) { - std::string reason("No CB configuration found!"); - LOG_ERROR(mysql_cb_logger, MYSQL_CB_RECONNECT_ATTEMPT_FAILED4) - .arg(reason); - return (true); + do_exit = true; + isc_throw(Unexpected, "No CB configuration found!"); } // Iterate over the configured DBs and instantiate them. @@ -2932,6 +2931,9 @@ public: } catch (const std::exception& ex) { LOG_ERROR(mysql_cb_logger, MYSQL_CB_RECONNECT_ATTEMPT_FAILED4) .arg(ex.what()); + if (do_exit) { + return (true); + } } if (reopened) { diff --git a/src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc b/src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc index fa3b457fff..342f95a031 100644 --- a/src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc +++ b/src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc @@ -3329,6 +3329,7 @@ public: } bool reopened = false; + bool do_exit = false; const std::string timer_name = db_reconnect_ctl->timerName(); @@ -3340,10 +3341,8 @@ public: // Something is definitely wrong. Did the configuration change // somehow and there is no configuration for CB? if (!config_ctl) { - std::string reason("No CB configuration found!"); - LOG_ERROR(mysql_cb_logger, MYSQL_CB_RECONNECT_ATTEMPT_FAILED6) - .arg(reason); - return (true); + do_exit = true; + isc_throw(Unexpected, "No CB configuration found!"); } // Iterate over the configured DBs and instantiate them. @@ -3359,6 +3358,9 @@ public: } catch (const std::exception& ex) { LOG_ERROR(mysql_cb_logger, MYSQL_CB_RECONNECT_ATTEMPT_FAILED6) .arg(ex.what()); + if (do_exit) { + return (true); + } } if (reopened) { diff --git a/src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc b/src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc index fe309301aa..5b6988aaef 100644 --- a/src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc +++ b/src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc @@ -2707,6 +2707,7 @@ public: } bool reopened = false; + bool do_exit = false; const std::string timer_name = db_reconnect_ctl->timerName(); @@ -2718,10 +2719,8 @@ public: // Something is definitely wrong. Did the configuration change // somehow and there is no configuration for CB? if (!config_ctl) { - std::string reason("No CB configuration found!"); - LOG_ERROR(pgsql_cb_logger, PGSQL_CB_RECONNECT_ATTEMPT_FAILED4) - .arg(reason); - return (true); + do_exit = true; + isc_throw(Unexpected, "No CB configuration found!"); } // Iterate over the configured DBs and instantiate them. @@ -2737,6 +2736,9 @@ public: } catch (const std::exception& ex) { LOG_ERROR(pgsql_cb_logger, PGSQL_CB_RECONNECT_ATTEMPT_FAILED4) .arg(ex.what()); + if (do_exit) { + return (true); + } } if (reopened) { diff --git a/src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc b/src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc index 28fcc1b2cc..5f693b3b9d 100644 --- a/src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc +++ b/src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc @@ -3029,6 +3029,7 @@ public: } bool reopened = false; + bool do_exit = false; const std::string timer_name = db_reconnect_ctl->timerName(); @@ -3040,10 +3041,8 @@ public: // Something is definitely wrong. Did the configuration change // somehow and there is no configuration for CB? if (!config_ctl) { - std::string reason("No CB configuration found!"); - LOG_ERROR(pgsql_cb_logger, PGSQL_CB_RECONNECT_ATTEMPT_FAILED6) - .arg(reason); - return (true); + do_exit = true; + isc_throw(Unexpected, "No CB configuration found!"); } // Iterate over the configured DBs and instantiate them. @@ -3059,6 +3058,9 @@ public: } catch (const std::exception& ex) { LOG_ERROR(pgsql_cb_logger, PGSQL_CB_RECONNECT_ATTEMPT_FAILED6) .arg(ex.what()); + if (do_exit) { + return (true); + } } if (reopened) { diff --git a/tools/exhonerated-duplicate-messages.txt b/tools/exhonerated-duplicate-messages.txt index a17a63dfd1..34db9b42dd 100644 --- a/tools/exhonerated-duplicate-messages.txt +++ b/tools/exhonerated-duplicate-messages.txt @@ -93,8 +93,6 @@ % HA_PAUSE_CLIENT_LISTENER_FAILED: 2 % LOG_BAD_STREAM: 4 % LOG_DUPLICATE_MESSAGE_ID: 4 - % MYSQL_CB_RECONNECT_ATTEMPT_FAILED4: 2 - % MYSQL_CB_RECONNECT_ATTEMPT_FAILED6: 2 % NETCONF_GET_CONFIG_FAILED: 4 % NETCONF_SET_CONFIG_FAILED: 5 % NETCONF_UPDATE_CONFIG_FAILED: 5 @@ -103,8 +101,6 @@ % DHCP4_PACKET_PROCESS_STD_EXCEPTION: 4 % DHCP6_PACKET_PROCESS_EXCEPTION: 4 % DHCP6_PACKET_PROCESS_STD_EXCEPTION: 4 - % PGSQL_CB_RECONNECT_ATTEMPT_FAILED4: 2 - % PGSQL_CB_RECONNECT_ATTEMPT_FAILED6: 2 % DCTL_CONFIG_FILE_LOAD_FAIL: 2 % LOG_DUPLICATE_NAMESPACE: 2 % LOG_NO_MESSAGE_ID: 2