From 6c84acf33bc50831bcbe3e584a813568b4f4e76f Mon Sep 17 00:00:00 2001 From: Thomas Markwalder Date: Thu, 6 Aug 2020 14:31:42 -0400 Subject: [PATCH] [#1369] Added retry logic to kea-dhcp6 and ChangeLog --- ChangeLog | 6 ++++++ src/bin/dhcp6/ctrl_dhcp6_srv.cc | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b2b61ca6b..c0241a25c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1792. [bug] tmark + Corrected a bug that causes kea-dhcp4/kea-dhcp6 servers to crash after + losing connectivity to a configuration backend database. The servers + now correctly honor the max-reconnect-tries parameter. + (Gitlab #1369) + 1781. [bug] razvan Reject invalid declined state for PD prefix in add and update commands in lease-cmds hook. diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index ed339a0abd..f89da13a0d 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -1155,10 +1155,17 @@ void ControlledDhcpv6Srv::dbReconnect(ReconnectCtlPtr db_reconnect_ctl) { bool reopened = false; - // Re-open lease and host database with new parameters. + // We lost at least one of them, Reopen all of them (lease, host, and CB databases) try { CfgDbAccessPtr cfg_db = CfgMgr::instance().getCurrentCfg()->getCfgDbAccess(); cfg_db->createManagers(); + + auto ctl_info = CfgMgr::instance().getCurrentCfg()->getConfigControlInfo(); + if (ctl_info) { + auto srv_cfg = CfgMgr::instance().getCurrentCfg(); + server_->getCBControl()->databaseConfigConnect(srv_cfg); + } + reopened = true; } catch (const std::exception& ex) { LOG_ERROR(dhcp6_logger, DHCP6_DB_RECONNECT_ATTEMPT_FAILED).arg(ex.what()); -- 2.47.2