2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#3315] addressed review comments

This commit is contained in:
Razvan Becheriu
2024-04-19 17:53:32 +03:00
parent 4398fb6c4a
commit cc104b47a8
42 changed files with 483 additions and 398 deletions

View File

@@ -6,6 +6,7 @@
#include <config.h>
#include <asiolink/io_service_mgr.h>
#include <cc/command_interpreter.h>
#include <config/command_mgr.h>
#include <database/dbaccess_parser.h>
@@ -879,6 +880,7 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
// change causes problems when trying to roll back.
HooksManager::prepareUnloadLibraries();
static_cast<void>(HooksManager::unloadLibraries());
IOServiceMgr::instance().clearIOServices();
const HooksConfig& libraries =
CfgMgr::instance().getStagingCfg()->getHooksConfig();
bool multi_threading_enabled = true;
@@ -934,6 +936,16 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
if (notify_libraries) {
return (notify_libraries);
}
/// Let postponed hook initializations to run.
try {
IOServiceMgr::instance().pollIOServices();
} catch (const std::exception& ex) {
std::ostringstream err;
err << "Error initializing hooks: "
<< ex.what();
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
}
return (answer);