Skip to content

Commit 68e735f

Browse files
committed
[#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)
1 parent fc59957 commit 68e735f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/bin/dhcp4/ctrl_dhcp4_srv.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
913913

914914
// Allow DB reconnect on startup. The database connection parameters specify
915915
// respective details.
916-
DbConnectionInitWithRetry retry;
916+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
917917

918918
// Single stream instance used in all error clauses
919919
std::ostringstream err;
@@ -1092,6 +1092,8 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
10921092
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
10931093
}
10941094

1095+
dbr.reset();
1096+
10951097
/// Let postponed hook initializations to run.
10961098
try {
10971099
ControlledDhcpv4Srv::getInstance()->getIOService()->poll();

src/bin/dhcp6/ctrl_dhcp6_srv.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
918918

919919
// Allow DB reconnect on startup. The database connection parameters specify
920920
// respective details.
921-
DbConnectionInitWithRetry retry;
921+
std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
922922

923923
// Single stream instance used in all error clauses
924924
std::ostringstream err;
@@ -1112,6 +1112,8 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
11121112
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
11131113
}
11141114

1115+
dbr.reset();
1116+
11151117
/// Let postponed hook initializations to run.
11161118
try {
11171119
ControlledDhcpv6Srv::getInstance()->getIOService()->poll();

0 commit comments

Comments
 (0)