]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3536] removed more duplicated messages
authorRazvan Becheriu <razvan@isc.org>
Thu, 3 Oct 2024 12:08:50 +0000 (15:08 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 3 Oct 2024 18:04:37 +0000 (21:04 +0300)
src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc
src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc
src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc
src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc
tools/exhonerated-duplicate-messages.txt

index fc5bb0df991ca7880ee76b995aba4b633c1c10cd..3ab91e1d318ef60e401df2712667b45a123d5c17 100644 (file)
@@ -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) {
index fa3b457fff337397ae5c2e4652246cc7585bd63e..342f95a0311fabd847fcbaed0c311031df8c6522 100644 (file)
@@ -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) {
index fe309301aa9df3b3c1719c26e77dfe5ecb3dddd6..5b6988aaef8e1d4c5a36ace4ac2e90cc1ec36f83 100644 (file)
@@ -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) {
index 28fcc1b2cce84b601c5f13c33d35d13bb3932351..5f693b3b9d6c6863edaf165f0eb4dd0f99e2fe80 100644 (file)
@@ -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) {
index a17a63dfd14cc5f5991f9e567ee9fb23020e05f0..34db9b42dd3fc713afd2f287d76d6120ad96a337 100644 (file)
@@ -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
     % 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