summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/lease_mgr_factory.h
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2018-02-28 21:29:23 +0100
committerThomas Markwalder <tmark@isc.org>2018-02-28 21:29:23 +0100
commit249219f1fc315bc6d799708c6a8bd3b3f847a951 (patch)
tree5ec7d9c1ee1466df13f342f5b0281ad4ca62ff7f /src/lib/dhcpsrv/lease_mgr_factory.h
parent[master] Updated git hash (diff)
downloadkea-249219f1fc315bc6d799708c6a8bd3b3f847a951.tar.xz
kea-249219f1fc315bc6d799708c6a8bd3b3f847a951.zip
[5477] dhcpsrv/postgres and kea-dhcp4 now support db reconnect
kea-dhcp4 added support for max-reconnect-tries and reconnect-wait-time to lease and host db parsers Added a callback for when DB backends detect loss of connectivity Added a self-rescheduling method to attempt to reconnect to the backends if retries are enabled dhcpsrv Added a callback that DatabaseConnection derivations should invoke when they lose connectivity. Added an optional callback parameter from CfgDbAccess::createManagers() all the way down to DatabaseConnection ctor. pgsql_connection.cc PgSqlConnection::~PgSqlConnection() - Added logic to close the connection only when the connect state is still OK. Otherwise it likes to core dump. PgSqlConnection::checkStatementError() - Modified to invoke the connectivity lost callback on "fatal" errors pgsql_lease_mgr_unittest.cc pgsql_host_data_source_unittest.cc Added tests to verify that the lost callback is NOT invoked on an open failure
Diffstat (limited to 'src/lib/dhcpsrv/lease_mgr_factory.h')
-rw-r--r--src/lib/dhcpsrv/lease_mgr_factory.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/dhcpsrv/lease_mgr_factory.h b/src/lib/dhcpsrv/lease_mgr_factory.h
index 4c6baf1270..e598951668 100644
--- a/src/lib/dhcpsrv/lease_mgr_factory.h
+++ b/src/lib/dhcpsrv/lease_mgr_factory.h
@@ -63,11 +63,15 @@ public:
/// -end specific, although must include the "type" keyword which
/// gives the backend in use.
///
+ /// @param db_lost_callback function to invoke if connectivity to lease
+ /// database is lost.
+ ///
/// @throw isc::InvalidParameter dbaccess string does not contain the "type"
/// keyword.
/// @throw isc::dhcp::InvalidType The "type" keyword in dbaccess does not
/// identify a supported backend.
- static void create(const std::string& dbaccess);
+ static void create(const std::string& dbaccess,
+ DatabaseConnection::Callback db_lost_callback = NULL);
/// @brief Destroy lease manager
///