summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2024-03-21 18:02:34 +0100
committerThomas Markwalder <tmark@isc.org>2024-03-21 20:33:37 +0100
commit68e735f1ebe556c473a30c24680616c628d29ce8 (patch)
tree6b65bf9bd15e7e7a949671e889cc39cf65c30d09 /src
parent[#3210] address review (diff)
downloadkea-68e735f1ebe556c473a30c24680616c628d29ce8.tar.xz
kea-68e735f1ebe556c473a30c24680616c628d29ce8.zip
[#3300] Fixed db-reconnect issue
src/bin/dhcp4/ctrl_dhcp4_srv.cc ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) src/bin/dhcp6/ctrl_dhcp6_srv.cc ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config)
Diffstat (limited to 'src')
-rw-r--r--src/bin/dhcp4/ctrl_dhcp4_srv.cc4
-rw-r--r--src/bin/dhcp6/ctrl_dhcp6_srv.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc
index ed0278fa8b..0c0a24c174 100644
--- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc
+++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc
@@ -913,7 +913,7 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
// Allow DB reconnect on startup. The database connection parameters specify
// respective details.
- DbConnectionInitWithRetry retry;
+ std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
// Single stream instance used in all error clauses
std::ostringstream err;
@@ -1092,6 +1092,8 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
+ dbr.reset();
+
/// Let postponed hook initializations to run.
try {
ControlledDhcpv4Srv::getInstance()->getIOService()->poll();
diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc
index cda7f8b87b..e304537ba9 100644
--- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc
+++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc
@@ -918,7 +918,7 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
// Allow DB reconnect on startup. The database connection parameters specify
// respective details.
- DbConnectionInitWithRetry retry;
+ std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
// Single stream instance used in all error clauses
std::ostringstream err;
@@ -1112,6 +1112,8 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
+ dbr.reset();
+
/// Let postponed hook initializations to run.
try {
ControlledDhcpv6Srv::getInstance()->getIOService()->poll();