]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2960] removed deprecated libreload command
authorRazvan Becheriu <razvan@isc.org>
Wed, 8 May 2024 09:29:35 +0000 (12:29 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 23 May 2024 14:08:16 +0000 (17:08 +0300)
18 files changed:
doc/sphinx/api-files.txt
doc/sphinx/arm/ctrl-channel.rst
doc/sphinx/arm/install.rst
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/ctrl_dhcp4_srv.h
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.h
src/bin/dhcp6/dhcp6_messages.cc
src/bin/dhcp6/dhcp6_messages.h
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/lib/hooks/hooks_config.cc
src/share/api/api_files.mk
src/share/api/libreload.json [deleted file]

index e0019f13ef5a347041a100197e5f96fa6e74f273..07c6e3d4ad92620a58c3c0293b40e909ef388189 100644 (file)
@@ -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
index dd47c7c6ac9b989de90308e70ac59d5b9d9e3754..227ad94420e8a89e22fbc2aa34df6c65330a791c 100644 (file)
@@ -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:
 
index 0ace22a76c4457e39b0fd532ed9e2eb028357a41..cb52b0a4b7e16a66d6eb6d58083af834de5b4437 100644 (file)
@@ -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.
index 6817415d620368567982656f6d91cf53947c7e50..d3e4960e3f3324d672c17dcfcce9bdaa8e176372 100644 (file)
@@ -228,43 +228,6 @@ ControlledDhcpv4Srv::commandShutdownHandler(const string&, ConstElementPtr args)
     return (createAnswer(CONTROL_RESULT_SUCCESS, "Shutting down."));
 }
 
-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*/) {
@@ -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");
index e4631db6991a0f13b237aa6fa72dfb7459fd6209..bcac18c4943a66cfd9b0b6bfe1348423f2490f1e 100644 (file)
@@ -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
index 110dfe06ec8631f8e7e1ced90cb152b53604fca3..678f3aa48e4b731a2697c608307541157f63f463 100644 (file)
@@ -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.",
index 9faa16296aa6be00ddedf2edd3640b5a64cc38ce..5c092aee892bf3de9658a2b8e5e519c859e05062 100644 (file)
@@ -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;
index ed36ddc620e2beb5615336176a8c27d7937a37b7..09e1555dbff481ab5fb5dbdd494ffc1c6dcbff27 100644 (file)
@@ -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
index 0b30f94cd79843276f9c1a5dd7018acc6a55a406..8ca7f74ba41c31655b344026985462a9492cd58b 100644 (file)
@@ -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");
index 224b4f32bf9e5f09c78768b5755bfbf0eaa850ec..c30dadfa50b2c8e72ac859154a9fae4ab78f4493 100644 (file)
@@ -231,43 +231,6 @@ ControlledDhcpv6Srv::commandShutdownHandler(const string&, ConstElementPtr args)
     return (createAnswer(CONTROL_RESULT_SUCCESS, "Shutting down."));
 }
 
-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*/) {
@@ -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");
index 756c7d6e8c64b172c4d411d04c49a7a772330c77..c1093be641e3c297e7838107b6eb3cb41c219cb1 100644 (file)
@@ -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
index 3c01ddb48a4909d3a87b55d88f855b66a23087f7..53ec6a2eed5ae1b106e7189742f7272cfc8db371 100644 (file)
@@ -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",
index dfcaa1925b68b5dc61d4befbbb4b8d66a73c70bc..70a37b83336da2b17f4fb61a34419196523ef1f6 100644 (file)
@@ -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;
index e82dfc172011be63b22351bc329b1aa0ef1e22ff..8027fefad1aaffef48c4a805fc9b499ee661fcf7 100644 (file)
@@ -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
index c8f5c873001b465676914067a10d7d3ce274311b..85f86e9006d88e18451da2edbdadcfee05be50b4 100644 (file)
@@ -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");
index caffd64f193356e35468da9f3be6b99e116b8f1c..af1170078447f2a3c78c82475a0f0796737078cc 100644 (file)
@@ -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
index 01faab16a8667cd05d2b4d31e34bad7e5f256cfe..75d016de0b0173feaa259c9f663d0f1c3be005c4 100644 (file)
@@ -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 (file)
index 75b4e7f..0000000
+++ /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"
-    ]
-}