ConstElementPtr
ControlledDhcpv4Srv::commandLibReloadHandler(const string&, ConstElementPtr) {
- // pause dhcp service when reloading libraries
+ // stop thread pool (if running)
MultiThreadingCriticalSection cs;
+
/// @todo delete any stored CalloutHandles referring to the old libraries
/// Get list of currently loaded libraries and reload them.
HookLibsCollection loaded = HooksManager::getLibraryInfo();
return (result);
}
+ // stop thread pool (if running)
+ MultiThreadingCriticalSection cs;
+
// disable multi-threading (it will be applied by new configuration)
+ // this must be done in order to properly handle MT to ST transition
+ // when 'multi-threading' structure is missing from new config
MultiThreadingMgr::instance().apply(false, 0, 0);
// We are starting the configuration process so we should remove any
CfgMgr::instance().getCurrentCfg()->applyLoggingCfg();
}
- // Configure multi threading
- try {
- CfgMultiThreading::apply(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading());
- if (MultiThreadingMgr::instance().getMode()) {
- LOG_FATAL(dhcp4_logger, DHCP4_MULTI_THREADING_WARNING);
- }
- } catch (const std::exception& ex) {
- err << "Error applying multi threading settings: "
- << ex.what();
- return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
- }
-
return (result);
}
return (createAnswer(CONTROL_RESULT_EMPTY, "No config backend."));
}
+ // stop thread pool (if running)
MultiThreadingCriticalSection cs;
// Reschedule the periodic CB fetch.
// operation.
}
+ // Configure multi threading
+ try {
+ CfgMultiThreading::apply(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading());
+ if (MultiThreadingMgr::instance().getMode()) {
+ LOG_FATAL(dhcp4_logger, DHCP4_MULTI_THREADING_WARNING);
+ }
+ } catch (const std::exception& ex) {
+ err << "Error applying multi threading settings: "
+ << ex.what();
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
+ }
+
return (answer);
}
void
ControlledDhcpv4Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
boost::shared_ptr<unsigned> failure_count) {
+ // stop thread pool (if running)
MultiThreadingCriticalSection cs;
try {
ConstElementPtr
ControlledDhcpv6Srv::commandLibReloadHandler(const string&, ConstElementPtr) {
- // pause dhcp service when reloading libraries
+ // stop thread pool (if running)
MultiThreadingCriticalSection cs;
+
/// @todo delete any stored CalloutHandles referring to the old libraries
/// Get list of currently loaded libraries and reload them.
HookLibsCollection loaded = HooksManager::getLibraryInfo();
return (result);
}
+ // stop thread pool (if running)
+ MultiThreadingCriticalSection cs;
+
// disable multi-threading (it will be applied by new configuration)
+ // this must be done in order to properly handle MT to ST transition
+ // when 'multi-threading' structure is missing from new config
MultiThreadingMgr::instance().apply(false, 0, 0);
// We are starting the configuration process so we should remove any
CfgMgr::instance().getCurrentCfg()->applyLoggingCfg();
}
- // Configure multi threading
- try {
- CfgMultiThreading::apply(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading());
- if (MultiThreadingMgr::instance().getMode()) {
- LOG_FATAL(dhcp6_logger, DHCP6_MULTI_THREADING_WARNING);
- }
- } catch (const std::exception& ex) {
- err << "Error applying multi threading settings: "
- << ex.what();
- return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
- }
-
return (result);
}
return (createAnswer(CONTROL_RESULT_EMPTY, "No config backend."));
}
+ // stop thread pool (if running)
MultiThreadingCriticalSection cs;
// Reschedule the periodic CB fetch.
// operation.
}
+ // Configure multi threading
+ try {
+ CfgMultiThreading::apply(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading());
+ if (MultiThreadingMgr::instance().getMode()) {
+ LOG_FATAL(dhcp6_logger, DHCP6_MULTI_THREADING_WARNING);
+ }
+ } catch (const std::exception& ex) {
+ err << "Error applying multi threading settings: "
+ << ex.what();
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
+ }
+
return (answer);
}
void
ControlledDhcpv6Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
boost::shared_ptr<unsigned> failure_count) {
+ // stop thread pool (if running)
MultiThreadingCriticalSection cs;
try {
/// @brief parses JSON structure.
///
/// This function stores the 'multi-threading' settings in the server
- /// configuration and applies the MT mode so that is can be checked when
+ /// configuration and updates the MT mode so that is can be checked when
/// parsing 'hooks-libraries'.
///
/// @param srv_cfg parsed value will be stored here.