summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2024-05-08 11:29:35 +0200
committerRazvan Becheriu <razvan@isc.org>2024-05-23 16:08:16 +0200
commit6d10d6424e4b6918c1fc30b69974e6a342f79bfa (patch)
tree975e17b8541b7f9afd6611ac73561f7ba4df4266
parent[#3340] Changes after review: (diff)
downloadkea-6d10d6424e4b6918c1fc30b69974e6a342f79bfa.tar.xz
kea-6d10d6424e4b6918c1fc30b69974e6a342f79bfa.zip
[#2960] removed deprecated libreload command
Diffstat (limited to '')
-rw-r--r--doc/sphinx/api-files.txt1
-rw-r--r--doc/sphinx/arm/ctrl-channel.rst25
-rw-r--r--doc/sphinx/arm/install.rst8
-rw-r--r--src/bin/dhcp4/ctrl_dhcp4_srv.cc44
-rw-r--r--src/bin/dhcp4/ctrl_dhcp4_srv.h14
-rw-r--r--src/bin/dhcp4/dhcp4_messages.cc2
-rw-r--r--src/bin/dhcp4/dhcp4_messages.h1
-rw-r--r--src/bin/dhcp4/dhcp4_messages.mes5
-rw-r--r--src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc92
-rw-r--r--src/bin/dhcp6/ctrl_dhcp6_srv.cc44
-rw-r--r--src/bin/dhcp6/ctrl_dhcp6_srv.h14
-rw-r--r--src/bin/dhcp6/dhcp6_messages.cc2
-rw-r--r--src/bin/dhcp6/dhcp6_messages.h1
-rw-r--r--src/bin/dhcp6/dhcp6_messages.mes5
-rw-r--r--src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc96
-rw-r--r--src/lib/hooks/hooks_config.cc5
-rw-r--r--src/share/api/api_files.mk1
-rw-r--r--src/share/api/libreload.json23
18 files changed, 1 insertions, 382 deletions
diff --git a/doc/sphinx/api-files.txt b/doc/sphinx/api-files.txt
index e0019f13ef..07c6e3d4ad 100644
--- a/doc/sphinx/api-files.txt
+++ b/doc/sphinx/api-files.txt
@@ -68,7 +68,6 @@ src/share/api/lease6-update.json
src/share/api/lease6-wipe.json
src/share/api/lease6-write.json
src/share/api/leases-reclaim.json
-src/share/api/libreload.json
src/share/api/list-commands.json
src/share/api/network4-add.json
src/share/api/network4-del.json
diff --git a/doc/sphinx/arm/ctrl-channel.rst b/doc/sphinx/arm/ctrl-channel.rst
index dd47c7c6ac..227ad94420 100644
--- a/doc/sphinx/arm/ctrl-channel.rst
+++ b/doc/sphinx/arm/ctrl-channel.rst
@@ -537,31 +537,6 @@ returning client that previously used that lease. See :ref:`lease-affinity`
for details. Also, see :ref:`lease-reclamation` for general
information about the processing of expired leases (lease reclamation).
-.. isccmd:: libreload
-.. _command-libreload:
-
-The ``libreload`` Command
--------------------------
-
-This command is now deprecated and will be removed in future Kea versions.
-
-The :isccmd:`libreload` command first unloads and then loads all currently
-loaded hook libraries. This is primarily intended to allow one or more
-hook libraries to be replaced with newer versions, without requiring Kea
-servers to be reconfigured or restarted. The hook libraries
-are passed the same parameter values (if any) that were passed when they
-were originally loaded.
-
-::
-
- {
- "command": "libreload",
- "arguments": { }
- }
-
-The server responds with a result of either 0, indicating success,
-or 1, indicating failure.
-
.. isccmd:: list-commands
.. _command-list-commands:
diff --git a/doc/sphinx/arm/install.rst b/doc/sphinx/arm/install.rst
index 0ace22a76c..cb52b0a4b7 100644
--- a/doc/sphinx/arm/install.rst
+++ b/doc/sphinx/arm/install.rst
@@ -650,11 +650,3 @@ Sysrepo 0.x or 1.x
Kea 2.3.2 introduced support for Sysrepo 2.x. Unfortunately,
Sysrepo continues to undergo major changes that are backward-incompatible,
and current Kea versions do not support Sysrepo earlier than versions 2.x.
-
-:isccmd:`libreload` command
-----------------------------------------
-
-The :isccmd:`libreload` command was deprecated in Kea 2.3.4. The code to handle this command is
-still there, but there are reports of it being buggy and not really usable.
-Kea 2.3 and 2.4 versions produce a warning when this command
-is used, and it will be removed entirely sometime in the 2.5 branch.
diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc
index 6817415d62..d3e4960e3f 100644
--- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc
+++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc
@@ -229,43 +229,6 @@ ControlledDhcpv4Srv::commandShutdownHandler(const string&, ConstElementPtr args)
}
ConstElementPtr
-ControlledDhcpv4Srv::commandLibReloadHandler(const string&, ConstElementPtr) {
- LOG_WARN(dhcp4_logger, DHCP4_DEPRECATED).arg("libreload command");
-
- // stop thread pool (if running)
- MultiThreadingCriticalSection cs;
-
- // Clear the packet queue.
- MultiThreadingMgr::instance().getThreadPool().reset();
-
- try {
- /// Get list of currently loaded libraries and reload them.
- HookLibsCollection loaded = HooksManager::getLibraryInfo();
- HooksManager::prepareUnloadLibraries();
- static_cast<void>(HooksManager::unloadLibraries());
- IOServiceMgr::instance().clearIOServices();
- bool multi_threading_enabled = true;
- uint32_t thread_count = 0;
- uint32_t queue_size = 0;
- CfgMultiThreading::extract(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading(),
- multi_threading_enabled, thread_count, queue_size);
- bool status = HooksManager::loadLibraries(loaded, multi_threading_enabled);
- if (!status) {
- isc_throw(Unexpected, "Failed to reload hooks libraries "
- "(WARNING: libreload is deprecated).");
- }
- } catch (const std::exception& ex) {
- LOG_ERROR(dhcp4_logger, DHCP4_HOOKS_LIBS_RELOAD_FAIL);
- ConstElementPtr answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
- return (answer);
- }
- ConstElementPtr answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS,
- "Hooks libraries successfully reloaded "
- "(WARNING: libreload is deprecated).");
- return (answer);
-}
-
-ConstElementPtr
ControlledDhcpv4Srv::commandConfigReloadHandler(const string&,
ConstElementPtr /*args*/) {
// Get configuration file name.
@@ -891,9 +854,6 @@ ControlledDhcpv4Srv::processCommand(const string& command,
if (command == "shutdown") {
return (srv->commandShutdownHandler(command, args));
- } else if (command == "libreload") {
- return (srv->commandLibReloadHandler(command, args));
-
} else if (command == "config-reload") {
return (srv->commandConfigReloadHandler(command, args));
@@ -1235,9 +1195,6 @@ ControlledDhcpv4Srv::ControlledDhcpv4Srv(uint16_t server_port /*= DHCP4_SERVER_P
CommandMgr::instance().registerCommand("dhcp-disable",
std::bind(&ControlledDhcpv4Srv::commandDhcpDisableHandler, this, ph::_1, ph::_2));
- CommandMgr::instance().registerCommand("libreload",
- std::bind(&ControlledDhcpv4Srv::commandLibReloadHandler, this, ph::_1, ph::_2));
-
CommandMgr::instance().registerCommand("leases-reclaim",
std::bind(&ControlledDhcpv4Srv::commandLeasesReclaimHandler, this, ph::_1, ph::_2));
@@ -1322,7 +1279,6 @@ ControlledDhcpv4Srv::~ControlledDhcpv4Srv() {
CommandMgr::instance().deregisterCommand("dhcp-disable");
CommandMgr::instance().deregisterCommand("dhcp-enable");
CommandMgr::instance().deregisterCommand("leases-reclaim");
- CommandMgr::instance().deregisterCommand("libreload");
CommandMgr::instance().deregisterCommand("server-tag-get");
CommandMgr::instance().deregisterCommand("shutdown");
CommandMgr::instance().deregisterCommand("statistic-get");
diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.h b/src/bin/dhcp4/ctrl_dhcp4_srv.h
index e4631db699..bcac18c494 100644
--- a/src/bin/dhcp4/ctrl_dhcp4_srv.h
+++ b/src/bin/dhcp4/ctrl_dhcp4_srv.h
@@ -81,7 +81,6 @@ public:
///
/// Currently supported commands are:
/// - shutdown
- /// - libreload
/// - config-reload
/// - config-set
/// - config-get
@@ -168,19 +167,6 @@ private:
commandShutdownHandler(const std::string& command,
isc::data::ConstElementPtr args);
- /// @brief Handler for processing 'libreload' command
- ///
- /// This handler processes libreload command, which unloads all hook
- /// libraries and reloads them.
- ///
- /// @param command (parameter ignored)
- /// @param args (parameter ignored)
- ///
- /// @return status of the command
- isc::data::ConstElementPtr
- commandLibReloadHandler(const std::string& command,
- isc::data::ConstElementPtr args);
-
/// @brief Handler for processing 'config-reload' command
///
/// This handler processes config-reload command, which processes
diff --git a/src/bin/dhcp4/dhcp4_messages.cc b/src/bin/dhcp4/dhcp4_messages.cc
index 110dfe06ec..678f3aa48e 100644
--- a/src/bin/dhcp4/dhcp4_messages.cc
+++ b/src/bin/dhcp4/dhcp4_messages.cc
@@ -77,7 +77,6 @@ extern const isc::log::MessageID DHCP4_EMPTY_HOSTNAME = "DHCP4_EMPTY_HOSTNAME";
extern const isc::log::MessageID DHCP4_FLEX_ID = "DHCP4_FLEX_ID";
extern const isc::log::MessageID DHCP4_GENERATE_FQDN = "DHCP4_GENERATE_FQDN";
extern const isc::log::MessageID DHCP4_HANDLE_SIGNAL_EXCEPTION = "DHCP4_HANDLE_SIGNAL_EXCEPTION";
-extern const isc::log::MessageID DHCP4_HOOKS_LIBS_RELOAD_FAIL = "DHCP4_HOOKS_LIBS_RELOAD_FAIL";
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_RCVD_DROP = "DHCP4_HOOK_BUFFER_RCVD_DROP";
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_RCVD_SKIP = "DHCP4_HOOK_BUFFER_RCVD_SKIP";
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_SEND_SKIP = "DHCP4_HOOK_BUFFER_SEND_SKIP";
@@ -266,7 +265,6 @@ const char* values[] = {
"DHCP4_FLEX_ID", "%1: flexible identifier generated for incoming packet: %2",
"DHCP4_GENERATE_FQDN", "%1: client did not send a FQDN or hostname; FQDN will be generated for the client",
"DHCP4_HANDLE_SIGNAL_EXCEPTION", "An exception was thrown while handing signal: %1",
- "DHCP4_HOOKS_LIBS_RELOAD_FAIL", "reload of hooks libraries failed",
"DHCP4_HOOK_BUFFER_RCVD_DROP", "received buffer from %1 to %2 over interface %3 was dropped because a callout set the drop flag",
"DHCP4_HOOK_BUFFER_RCVD_SKIP", "received buffer from %1 to %2 over interface %3 is not parsed because a callout set the next step to SKIP.",
"DHCP4_HOOK_BUFFER_SEND_SKIP", "%1: prepared response is dropped because a callout set the next step to SKIP.",
diff --git a/src/bin/dhcp4/dhcp4_messages.h b/src/bin/dhcp4/dhcp4_messages.h
index 9faa16296a..5c092aee89 100644
--- a/src/bin/dhcp4/dhcp4_messages.h
+++ b/src/bin/dhcp4/dhcp4_messages.h
@@ -78,7 +78,6 @@ extern const isc::log::MessageID DHCP4_EMPTY_HOSTNAME;
extern const isc::log::MessageID DHCP4_FLEX_ID;
extern const isc::log::MessageID DHCP4_GENERATE_FQDN;
extern const isc::log::MessageID DHCP4_HANDLE_SIGNAL_EXCEPTION;
-extern const isc::log::MessageID DHCP4_HOOKS_LIBS_RELOAD_FAIL;
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_RCVD_DROP;
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_RCVD_SKIP;
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_SEND_SKIP;
diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes
index ed36ddc620..09e1555dbf 100644
--- a/src/bin/dhcp4/dhcp4_messages.mes
+++ b/src/bin/dhcp4/dhcp4_messages.mes
@@ -413,11 +413,6 @@ create DNS entries for unsophisticated clients.
This error message is printed when an ISC or standard exception was raised during signal
processing. This likely indicates a coding error and should be reported to ISC.
-% DHCP4_HOOKS_LIBS_RELOAD_FAIL reload of hooks libraries failed
-A "libreload" command was issued to reload the hooks libraries but for
-some reason the reload failed. Other error messages issued from the
-hooks framework will indicate the nature of the problem.
-
% DHCP4_HOOK_BUFFER_RCVD_DROP received buffer from %1 to %2 over interface %3 was dropped because a callout set the drop flag
This debug message is printed when a callout installed on buffer4_receive
hook point set the drop flag. For this particular hook point, the
diff --git a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
index 0b30f94cd7..8ca7f74ba4 100644
--- a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
+++ b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
@@ -448,96 +448,6 @@ TEST_F(CtrlChannelDhcpv4SrvTest, commands) {
EXPECT_EQ(77, server_->getExitValue());
}
-// Check that the "libreload" command will reload libraries
-TEST_F(CtrlChannelDhcpv4SrvTest, libreload) {
- createUnixChannelServer();
-
- // Ensure no marker files to start with.
- ASSERT_FALSE(checkMarkerFileExists(LOAD_MARKER_FILE));
- ASSERT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
-
- // Load two libraries
- HookLibsCollection libraries;
- libraries.push_back(make_pair(CALLOUT_LIBRARY_1, ConstElementPtr()));
- HooksManager::loadLibraries(libraries);
-
- // Check they are loaded.
- HookLibsCollection loaded_libraries =
- HooksManager::getLibraryInfo();
- ASSERT_TRUE(libraries == loaded_libraries);
-
- EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "1"));
- EXPECT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
-
- // Now execute the "libreload" command. This should cause the libraries
- // to unload and to reload.
- std::string response;
- sendUnixCommand("{ \"command\": \"libreload\" }", response);
- EXPECT_EQ("{ \"result\": 0, "
- "\"text\": \"Hooks libraries successfully reloaded "
- "(WARNING: libreload is deprecated).\" }"
- , response);
-
- // Check that the libraries have unloaded and reloaded. The libraries are
- // unloaded in the reverse order to which they are loaded. When they load,
- // they should append information to the loading marker file.
- EXPECT_TRUE(checkMarkerFile(UNLOAD_MARKER_FILE, "1"));
- EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "11"));
-}
-
-// Check that the "libreload" command will fail to reload libraries which are
-// not compatible when multi-threading is enabled
-TEST_F(CtrlChannelDhcpv4SrvTest, libreloadFailMultiThreading) {
- createUnixChannelServer();
-
- // Ensure no marker files to start with.
- ASSERT_FALSE(checkMarkerFileExists(LOAD_MARKER_FILE));
- ASSERT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
-
- // Disable multi-threading to temporarily trick the hook manager
- // into loading single-threaded libraries.
- MultiThreadingMgr::instance().setMode(false);
-
- // Load two libraries
- HookLibsCollection libraries;
- libraries.push_back(make_pair(CALLOUT_LIBRARY_1, ConstElementPtr()));
- libraries.push_back(make_pair(CALLOUT_LIBRARY_2, ConstElementPtr()));
- HooksManager::loadLibraries(libraries);
-
- // Check they are loaded.
- HookLibsCollection loaded_libraries =
- HooksManager::getLibraryInfo();
- ASSERT_TRUE(libraries == loaded_libraries);
-
- // ... which also included checking that the marker file created by the
- // load functions exists and holds the correct value (of "12" - the
- // first library appends "1" to the file, the second appends "2"). Also
- // check that the unload marker file does not yet exist.
- EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "12"));
- EXPECT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
-
- // Enable multi-threading before libreload command which should now fail
- // as the second library is not multi-threading compatible.
- MultiThreadingMgr::instance().setMode(true);
-
- // Now execute the "libreload" command. This should cause the libraries
- // to unload and to reload.
- std::string response;
- sendUnixCommand("{ \"command\": \"libreload\" }", response);
- EXPECT_EQ("{ \"result\": 1, "
- "\"text\": \"Failed to reload hooks libraries"
- " (WARNING: libreload is deprecated).\" }"
- , response);
-
- // Check that the libraries have unloaded and failed to reload. The
- // libraries are unloaded in the reverse order to which they are loaded.
- // When they load, they should append information to the loading marker
- // file. Failing to load the second library will also unload the first
- // library.
- EXPECT_TRUE(checkMarkerFile(UNLOAD_MARKER_FILE, "211"));
- EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "121"));
-}
-
// This test checks which commands are registered by the DHCPv4 server.
TEST_F(CtrlChannelDhcpv4SrvTest, commandsRegistration) {
@@ -570,7 +480,6 @@ TEST_F(CtrlChannelDhcpv4SrvTest, commandsRegistration) {
EXPECT_TRUE(command_list.find("\"config-set\"") != string::npos);
EXPECT_TRUE(command_list.find("\"config-write\"") != string::npos);
EXPECT_TRUE(command_list.find("\"leases-reclaim\"") != string::npos);
- EXPECT_TRUE(command_list.find("\"libreload\"") != string::npos);
EXPECT_TRUE(command_list.find("\"server-tag-get\"") != string::npos);
EXPECT_TRUE(command_list.find("\"shutdown\"") != string::npos);
EXPECT_TRUE(command_list.find("\"statistic-get\"") != string::npos);
@@ -1509,7 +1418,6 @@ TEST_F(CtrlChannelDhcpv4SrvTest, listCommands) {
checkListCommands(rsp, "config-write");
checkListCommands(rsp, "list-commands");
checkListCommands(rsp, "leases-reclaim");
- checkListCommands(rsp, "libreload");
checkListCommands(rsp, "version-get");
checkListCommands(rsp, "server-tag-get");
checkListCommands(rsp, "shutdown");
diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc
index 224b4f32bf..c30dadfa50 100644
--- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc
+++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc
@@ -232,43 +232,6 @@ ControlledDhcpv6Srv::commandShutdownHandler(const string&, ConstElementPtr args)
}
ConstElementPtr
-ControlledDhcpv6Srv::commandLibReloadHandler(const string&, ConstElementPtr) {
- LOG_WARN(dhcp6_logger, DHCP6_DEPRECATED).arg("libreload command");
-
- // stop thread pool (if running)
- MultiThreadingCriticalSection cs;
-
- // Clear the packet queue.
- MultiThreadingMgr::instance().getThreadPool().reset();
-
- try {
- /// Get list of currently loaded libraries and reload them.
- HookLibsCollection loaded = HooksManager::getLibraryInfo();
- HooksManager::prepareUnloadLibraries();
- static_cast<void>(HooksManager::unloadLibraries());
- IOServiceMgr::instance().clearIOServices();
- bool multi_threading_enabled = true;
- uint32_t thread_count = 0;
- uint32_t queue_size = 0;
- CfgMultiThreading::extract(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading(),
- multi_threading_enabled, thread_count, queue_size);
- bool status = HooksManager::loadLibraries(loaded, multi_threading_enabled);
- if (!status) {
- isc_throw(Unexpected, "Failed to reload hooks libraries "
- "(WARNING: libreload is deprecated).");
- }
- } catch (const std::exception& ex) {
- LOG_ERROR(dhcp6_logger, DHCP6_HOOKS_LIBS_RELOAD_FAIL);
- ConstElementPtr answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
- return (answer);
- }
- ConstElementPtr answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS,
- "Hooks libraries successfully reloaded "
- "(WARNING: libreload is deprecated).");
- return (answer);
-}
-
-ConstElementPtr
ControlledDhcpv6Srv::commandConfigReloadHandler(const string&,
ConstElementPtr /*args*/) {
// Get configuration file name.
@@ -896,9 +859,6 @@ ControlledDhcpv6Srv::processCommand(const string& command,
if (command == "shutdown") {
return (srv->commandShutdownHandler(command, args));
- } else if (command == "libreload") {
- return (srv->commandLibReloadHandler(command, args));
-
} else if (command == "config-reload") {
return (srv->commandConfigReloadHandler(command, args));
@@ -1258,9 +1218,6 @@ ControlledDhcpv6Srv::ControlledDhcpv6Srv(uint16_t server_port /*= DHCP6_SERVER_P
CommandMgr::instance().registerCommand("dhcp-disable",
std::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler, this, ph::_1, ph::_2));
- CommandMgr::instance().registerCommand("libreload",
- std::bind(&ControlledDhcpv6Srv::commandLibReloadHandler, this, ph::_1, ph::_2));
-
CommandMgr::instance().registerCommand("leases-reclaim",
std::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler, this, ph::_1, ph::_2));
@@ -1345,7 +1302,6 @@ ControlledDhcpv6Srv::~ControlledDhcpv6Srv() {
CommandMgr::instance().deregisterCommand("dhcp-disable");
CommandMgr::instance().deregisterCommand("dhcp-enable");
CommandMgr::instance().deregisterCommand("leases-reclaim");
- CommandMgr::instance().deregisterCommand("libreload");
CommandMgr::instance().deregisterCommand("server-tag-get");
CommandMgr::instance().deregisterCommand("shutdown");
CommandMgr::instance().deregisterCommand("statistic-get");
diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.h b/src/bin/dhcp6/ctrl_dhcp6_srv.h
index 756c7d6e8c..c1093be641 100644
--- a/src/bin/dhcp6/ctrl_dhcp6_srv.h
+++ b/src/bin/dhcp6/ctrl_dhcp6_srv.h
@@ -81,7 +81,6 @@ public:
///
/// Currently supported commands are:
/// - shutdown
- /// - libreload
/// - config-reload
/// - config-set
/// - config-get
@@ -168,19 +167,6 @@ private:
commandShutdownHandler(const std::string& command,
isc::data::ConstElementPtr args);
- /// @brief Handler for processing 'libreload' command
- ///
- /// This handler processes libreload command, which unloads all hook
- /// libraries and reloads them.
- ///
- /// @param command (parameter ignored)
- /// @param args (parameter ignored)
- ///
- /// @return status of the command
- isc::data::ConstElementPtr
- commandLibReloadHandler(const std::string& command,
- isc::data::ConstElementPtr args);
-
/// @brief Handler for processing 'config-reload' command
///
/// This handler processes config-reload command, which processes
diff --git a/src/bin/dhcp6/dhcp6_messages.cc b/src/bin/dhcp6/dhcp6_messages.cc
index 3c01ddb48a..53ec6a2eed 100644
--- a/src/bin/dhcp6/dhcp6_messages.cc
+++ b/src/bin/dhcp6/dhcp6_messages.cc
@@ -69,7 +69,6 @@ extern const isc::log::MessageID DHCP6_DYNAMIC_RECONFIGURATION_FAIL = "DHCP6_DYN
extern const isc::log::MessageID DHCP6_DYNAMIC_RECONFIGURATION_SUCCESS = "DHCP6_DYNAMIC_RECONFIGURATION_SUCCESS";
extern const isc::log::MessageID DHCP6_FLEX_ID = "DHCP6_FLEX_ID";
extern const isc::log::MessageID DHCP6_HANDLE_SIGNAL_EXCEPTION = "DHCP6_HANDLE_SIGNAL_EXCEPTION";
-extern const isc::log::MessageID DHCP6_HOOKS_LIBS_RELOAD_FAIL = "DHCP6_HOOKS_LIBS_RELOAD_FAIL";
extern const isc::log::MessageID DHCP6_HOOK_BUFFER_RCVD_DROP = "DHCP6_HOOK_BUFFER_RCVD_DROP";
extern const isc::log::MessageID DHCP6_HOOK_BUFFER_RCVD_SKIP = "DHCP6_HOOK_BUFFER_RCVD_SKIP";
extern const isc::log::MessageID DHCP6_HOOK_BUFFER_SEND_SKIP = "DHCP6_HOOK_BUFFER_SEND_SKIP";
@@ -247,7 +246,6 @@ const char* values[] = {
"DHCP6_DYNAMIC_RECONFIGURATION_SUCCESS", "dynamic server reconfiguration succeeded with file: %1",
"DHCP6_FLEX_ID", "%1: flexible identifier generated for incoming packet: %2",
"DHCP6_HANDLE_SIGNAL_EXCEPTION", "An exception was thrown while handing signal: %1",
- "DHCP6_HOOKS_LIBS_RELOAD_FAIL", "reload of hooks libraries failed",
"DHCP6_HOOK_BUFFER_RCVD_DROP", "received buffer from %1 to %2 over interface %3 was dropped because a callout set the drop flag",
"DHCP6_HOOK_BUFFER_RCVD_SKIP", "received buffer from %1 to %2 over interface %3 is not parsed because a callout set the next step to SKIP",
"DHCP6_HOOK_BUFFER_SEND_SKIP", "%1: prepared DHCPv6 response was dropped because a callout set the next step to SKIP",
diff --git a/src/bin/dhcp6/dhcp6_messages.h b/src/bin/dhcp6/dhcp6_messages.h
index dfcaa1925b..70a37b8333 100644
--- a/src/bin/dhcp6/dhcp6_messages.h
+++ b/src/bin/dhcp6/dhcp6_messages.h
@@ -70,7 +70,6 @@ extern const isc::log::MessageID DHCP6_DYNAMIC_RECONFIGURATION_FAIL;
extern const isc::log::MessageID DHCP6_DYNAMIC_RECONFIGURATION_SUCCESS;
extern const isc::log::MessageID DHCP6_FLEX_ID;
extern const isc::log::MessageID DHCP6_HANDLE_SIGNAL_EXCEPTION;
-extern const isc::log::MessageID DHCP6_HOOKS_LIBS_RELOAD_FAIL;
extern const isc::log::MessageID DHCP6_HOOK_BUFFER_RCVD_DROP;
extern const isc::log::MessageID DHCP6_HOOK_BUFFER_RCVD_SKIP;
extern const isc::log::MessageID DHCP6_HOOK_BUFFER_SEND_SKIP;
diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes
index e82dfc1720..8027fefad1 100644
--- a/src/bin/dhcp6/dhcp6_messages.mes
+++ b/src/bin/dhcp6/dhcp6_messages.mes
@@ -368,11 +368,6 @@ debugging assistance for flexible identifier.
This error message is printed when an exception was raised during signal
processing. This likely indicates a coding error and should be reported to ISC.
-% DHCP6_HOOKS_LIBS_RELOAD_FAIL reload of hooks libraries failed
-A "libreload" command was issued to reload the hooks libraries but for
-some reason the reload failed. Other error messages issued from the
-hooks framework will indicate the nature of the problem.
-
% DHCP6_HOOK_BUFFER_RCVD_DROP received buffer from %1 to %2 over interface %3 was dropped because a callout set the drop flag
This debug message is printed when a callout installed on buffer6_receive
hook point set the drop flag. For this particular hook point, the
diff --git a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
index c8f5c87300..85f86e9006 100644
--- a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
+++ b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
@@ -472,100 +472,6 @@ TEST_F(CtrlDhcpv6SrvTest, commands) {
EXPECT_EQ(77, srv->getExitValue());
}
-// Check that the "libreload" command will reload libraries
-TEST_F(CtrlChannelDhcpv6SrvTest, libreload) {
- createUnixChannelServer();
-
- // Ensure no marker files to start with.
- ASSERT_FALSE(checkMarkerFileExists(LOAD_MARKER_FILE));
- ASSERT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
-
- // Load two libraries
- HookLibsCollection libraries;
- libraries.push_back(make_pair(CALLOUT_LIBRARY_1, ConstElementPtr()));
- HooksManager::loadLibraries(libraries);
-
- // Check they are loaded.
- HookLibsCollection loaded_libraries =
- HooksManager::getLibraryInfo();
- ASSERT_TRUE(libraries == loaded_libraries);
-
- // ... which also included checking that the marker file created by the
- // load functions exists and holds the correct value (of "12" - the
- // first library appends "1" to the file, the second appends "2"). Also
- // check that the unload marker file does not yet exist.
- EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "1"));
- EXPECT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
-
- // Now execute the "libreload" command. This should cause the libraries
- // to unload and to reload.
- std::string response;
- sendUnixCommand("{ \"command\": \"libreload\" }", response);
- EXPECT_EQ("{ \"result\": 0, "
- "\"text\": \"Hooks libraries successfully reloaded"
- " (WARNING: libreload is deprecated).\" }"
- , response);
-
- // Check that the libraries have unloaded and reloaded. The libraries are
- // unloaded in the reverse order to which they are loaded. When they load,
- // they should append information to the loading marker file.
- EXPECT_TRUE(checkMarkerFile(UNLOAD_MARKER_FILE, "1"));
- EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "11"));
-}
-
-// Check that the "libreload" command will fail to reload libraries which are
-// not compatible when multi-threading is enabled
-TEST_F(CtrlChannelDhcpv6SrvTest, libreloadFailMultiThreading) {
- createUnixChannelServer();
-
- // Ensure no marker files to start with.
- ASSERT_FALSE(checkMarkerFileExists(LOAD_MARKER_FILE));
- ASSERT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
-
- // Disable multi-threading to temporarily trick the hook manager
- // into loading single-threaded libraries.
- MultiThreadingMgr::instance().setMode(false);
-
- // Load two libraries
- HookLibsCollection libraries;
- libraries.push_back(make_pair(CALLOUT_LIBRARY_1, ConstElementPtr()));
- libraries.push_back(make_pair(CALLOUT_LIBRARY_2, ConstElementPtr()));
- HooksManager::loadLibraries(libraries);
-
- // Check they are loaded.
- HookLibsCollection loaded_libraries =
- HooksManager::getLibraryInfo();
- ASSERT_TRUE(libraries == loaded_libraries);
-
- // ... which also included checking that the marker file created by the
- // load functions exists and holds the correct value (of "12" - the
- // first library appends "1" to the file, the second appends "2"). Also
- // check that the unload marker file does not yet exist.
- EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "12"));
- EXPECT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
-
- // Enable multi-threading before libreload command which should now fail
- // as the second library is not multi-threading compatible.
- MultiThreadingMgr::instance().setMode(true);
-
- // Now execute the "libreload" command. This should cause the libraries
- // to unload and to reload.
- std::string response;
- sendUnixCommand("{ \"command\": \"libreload\" }", response);
- EXPECT_EQ("{ \"result\": 1, "
- "\"text\": \"Failed to reload hooks libraries "
- "(WARNING: libreload is deprecated).\" }"
- , response);
-
- // Check that the libraries have unloaded and failed to reload. The
- // libraries are unloaded in the reverse order to which they are loaded.
- // When they load, they should append information to the loading marker
- // file. Failing to load the second library will also unload the first
- // library.
- EXPECT_TRUE(checkMarkerFile(UNLOAD_MARKER_FILE, "211"));
- EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "121"));
-}
-
typedef std::map<std::string, isc::data::ConstElementPtr> ElementMap;
// This test checks which commands are registered by the DHCPv6 server.
@@ -601,7 +507,6 @@ TEST_F(CtrlDhcpv6SrvTest, commandsRegistration) {
EXPECT_TRUE(command_list.find("\"config-set\"") != string::npos);
EXPECT_TRUE(command_list.find("\"config-write\"") != string::npos);
EXPECT_TRUE(command_list.find("\"leases-reclaim\"") != string::npos);
- EXPECT_TRUE(command_list.find("\"libreload\"") != string::npos);
EXPECT_TRUE(command_list.find("\"server-tag-get\"") != string::npos);
EXPECT_TRUE(command_list.find("\"shutdown\"") != string::npos);
EXPECT_TRUE(command_list.find("\"statistic-get\"") != string::npos);
@@ -1549,7 +1454,6 @@ TEST_F(CtrlChannelDhcpv6SrvTest, listCommands) {
checkListCommands(rsp, "config-write");
checkListCommands(rsp, "list-commands");
checkListCommands(rsp, "leases-reclaim");
- checkListCommands(rsp, "libreload");
checkListCommands(rsp, "version-get");
checkListCommands(rsp, "server-tag-get");
checkListCommands(rsp, "shutdown");
diff --git a/src/lib/hooks/hooks_config.cc b/src/lib/hooks/hooks_config.cc
index caffd64f19..af11700784 100644
--- a/src/lib/hooks/hooks_config.cc
+++ b/src/lib/hooks/hooks_config.cc
@@ -21,10 +21,7 @@ HooksConfig::verifyLibraries(const Element::Position& position,
bool multi_threading_enabled) const {
// The code used to follow this logic:
//
- // Check if the list of libraries has changed. If not, nothing is done
- // - the command "DhcpN libreload" is required to reload the same
- // libraries (this prevents needless reloads when anything else in the
- // configuration is changed).
+ // Check if the list of libraries has changed. If not, nothing is done.
//
// We no longer rely on this. Parameters can change. And even if the
// parameters stay the same, they could point to files that could
diff --git a/src/share/api/api_files.mk b/src/share/api/api_files.mk
index 01faab16a8..75d016de0b 100644
--- a/src/share/api/api_files.mk
+++ b/src/share/api/api_files.mk
@@ -68,7 +68,6 @@ api_files += $(top_srcdir)/src/share/api/lease6-update.json
api_files += $(top_srcdir)/src/share/api/lease6-wipe.json
api_files += $(top_srcdir)/src/share/api/lease6-write.json
api_files += $(top_srcdir)/src/share/api/leases-reclaim.json
-api_files += $(top_srcdir)/src/share/api/libreload.json
api_files += $(top_srcdir)/src/share/api/list-commands.json
api_files += $(top_srcdir)/src/share/api/network4-add.json
api_files += $(top_srcdir)/src/share/api/network4-del.json
diff --git a/src/share/api/libreload.json b/src/share/api/libreload.json
deleted file mode 100644
index 75b4e7f07b..0000000000
--- a/src/share/api/libreload.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "access": "write",
- "avail": "1.2.0",
- "brief": [
- "This command first unloads and then reloads all currently loaded hooks libraries.",
- "This command is deprecated and will be removed in future Kea versions."
- ],
- "cmd-comment": [
- "The server responds with 0, indicating success, or 1, indicating a failure."
- ],
- "cmd-syntax": [
- "{",
- " \"command\": \"libreload\",",
- " \"arguments\": { }",
- "}"
- ],
- "description": "See <xref linkend=\"command-libreload\"/>",
- "name": "libreload",
- "support": [
- "kea-dhcp4",
- "kea-dhcp6"
- ]
-}