Skip to content

Commit 6dbb732

Browse files
author
Razvan Becheriu
committed
[#3536] removed more duplicated messages
1 parent d740982 commit 6dbb732

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,6 +2902,7 @@ class MySqlConfigBackendDHCPv4Impl : public MySqlConfigBackendImpl {
29022902
}
29032903

29042904
bool reopened = false;
2905+
bool do_exit = false;
29052906

29062907
const std::string timer_name = db_reconnect_ctl->timerName();
29072908

@@ -2913,10 +2914,8 @@ class MySqlConfigBackendDHCPv4Impl : public MySqlConfigBackendImpl {
29132914
// Something is definitely wrong. Did the configuration change
29142915
// somehow and there is no configuration for CB?
29152916
if (!config_ctl) {
2916-
std::string reason("No CB configuration found!");
2917-
LOG_ERROR(mysql_cb_logger, MYSQL_CB_RECONNECT_ATTEMPT_FAILED4)
2918-
.arg(reason);
2919-
return (true);
2917+
do_exit = true;
2918+
isc_throw(Unexpected, "No CB configuration found!");
29202919
}
29212920

29222921
// Iterate over the configured DBs and instantiate them.
@@ -2932,6 +2931,9 @@ class MySqlConfigBackendDHCPv4Impl : public MySqlConfigBackendImpl {
29322931
} catch (const std::exception& ex) {
29332932
LOG_ERROR(mysql_cb_logger, MYSQL_CB_RECONNECT_ATTEMPT_FAILED4)
29342933
.arg(ex.what());
2934+
if (do_exit) {
2935+
return (true);
2936+
}
29352937
}
29362938

29372939
if (reopened) {

src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3329,6 +3329,7 @@ class MySqlConfigBackendDHCPv6Impl : public MySqlConfigBackendImpl {
33293329
}
33303330

33313331
bool reopened = false;
3332+
bool do_exit = false;
33323333

33333334
const std::string timer_name = db_reconnect_ctl->timerName();
33343335

@@ -3340,10 +3341,8 @@ class MySqlConfigBackendDHCPv6Impl : public MySqlConfigBackendImpl {
33403341
// Something is definitely wrong. Did the configuration change
33413342
// somehow and there is no configuration for CB?
33423343
if (!config_ctl) {
3343-
std::string reason("No CB configuration found!");
3344-
LOG_ERROR(mysql_cb_logger, MYSQL_CB_RECONNECT_ATTEMPT_FAILED6)
3345-
.arg(reason);
3346-
return (true);
3344+
do_exit = true;
3345+
isc_throw(Unexpected, "No CB configuration found!");
33473346
}
33483347

33493348
// Iterate over the configured DBs and instantiate them.
@@ -3359,6 +3358,9 @@ class MySqlConfigBackendDHCPv6Impl : public MySqlConfigBackendImpl {
33593358
} catch (const std::exception& ex) {
33603359
LOG_ERROR(mysql_cb_logger, MYSQL_CB_RECONNECT_ATTEMPT_FAILED6)
33613360
.arg(ex.what());
3361+
if (do_exit) {
3362+
return (true);
3363+
}
33623364
}
33633365

33643366
if (reopened) {

src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,6 +2707,7 @@ class PgSqlConfigBackendDHCPv4Impl : public PgSqlConfigBackendImpl {
27072707
}
27082708

27092709
bool reopened = false;
2710+
bool do_exit = false;
27102711

27112712
const std::string timer_name = db_reconnect_ctl->timerName();
27122713

@@ -2718,10 +2719,8 @@ class PgSqlConfigBackendDHCPv4Impl : public PgSqlConfigBackendImpl {
27182719
// Something is definitely wrong. Did the configuration change
27192720
// somehow and there is no configuration for CB?
27202721
if (!config_ctl) {
2721-
std::string reason("No CB configuration found!");
2722-
LOG_ERROR(pgsql_cb_logger, PGSQL_CB_RECONNECT_ATTEMPT_FAILED4)
2723-
.arg(reason);
2724-
return (true);
2722+
do_exit = true;
2723+
isc_throw(Unexpected, "No CB configuration found!");
27252724
}
27262725

27272726
// Iterate over the configured DBs and instantiate them.
@@ -2737,6 +2736,9 @@ class PgSqlConfigBackendDHCPv4Impl : public PgSqlConfigBackendImpl {
27372736
} catch (const std::exception& ex) {
27382737
LOG_ERROR(pgsql_cb_logger, PGSQL_CB_RECONNECT_ATTEMPT_FAILED4)
27392738
.arg(ex.what());
2739+
if (do_exit) {
2740+
return (true);
2741+
}
27402742
}
27412743

27422744
if (reopened) {

src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,6 +3029,7 @@ class PgSqlConfigBackendDHCPv6Impl : public PgSqlConfigBackendImpl {
30293029
}
30303030

30313031
bool reopened = false;
3032+
bool do_exit = false;
30323033

30333034
const std::string timer_name = db_reconnect_ctl->timerName();
30343035

@@ -3040,10 +3041,8 @@ class PgSqlConfigBackendDHCPv6Impl : public PgSqlConfigBackendImpl {
30403041
// Something is definitely wrong. Did the configuration change
30413042
// somehow and there is no configuration for CB?
30423043
if (!config_ctl) {
3043-
std::string reason("No CB configuration found!");
3044-
LOG_ERROR(pgsql_cb_logger, PGSQL_CB_RECONNECT_ATTEMPT_FAILED6)
3045-
.arg(reason);
3046-
return (true);
3044+
do_exit = true;
3045+
isc_throw(Unexpected, "No CB configuration found!");
30473046
}
30483047

30493048
// Iterate over the configured DBs and instantiate them.
@@ -3059,6 +3058,9 @@ class PgSqlConfigBackendDHCPv6Impl : public PgSqlConfigBackendImpl {
30593058
} catch (const std::exception& ex) {
30603059
LOG_ERROR(pgsql_cb_logger, PGSQL_CB_RECONNECT_ATTEMPT_FAILED6)
30613060
.arg(ex.what());
3061+
if (do_exit) {
3062+
return (true);
3063+
}
30623064
}
30633065

30643066
if (reopened) {

tools/exhonerated-duplicate-messages.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@
9393
% HA_PAUSE_CLIENT_LISTENER_FAILED: 2
9494
% LOG_BAD_STREAM: 4
9595
% LOG_DUPLICATE_MESSAGE_ID: 4
96-
% MYSQL_CB_RECONNECT_ATTEMPT_FAILED4: 2
97-
% MYSQL_CB_RECONNECT_ATTEMPT_FAILED6: 2
9896
% NETCONF_GET_CONFIG_FAILED: 4
9997
% NETCONF_SET_CONFIG_FAILED: 5
10098
% NETCONF_UPDATE_CONFIG_FAILED: 5
@@ -103,8 +101,6 @@
103101
% DHCP4_PACKET_PROCESS_STD_EXCEPTION: 4
104102
% DHCP6_PACKET_PROCESS_EXCEPTION: 4
105103
% DHCP6_PACKET_PROCESS_STD_EXCEPTION: 4
106-
% PGSQL_CB_RECONNECT_ATTEMPT_FAILED4: 2
107-
% PGSQL_CB_RECONNECT_ATTEMPT_FAILED6: 2
108104
% DCTL_CONFIG_FILE_LOAD_FAIL: 2
109105
% LOG_DUPLICATE_NAMESPACE: 2
110106
% LOG_NO_MESSAGE_ID: 2

0 commit comments

Comments
 (0)