Skip to content

Commit 6d10d64

Browse files
author
Razvan Becheriu
committed
[#2960] removed deprecated libreload command
1 parent 6f66da2 commit 6d10d64

18 files changed

+1
-382
lines changed

doc/sphinx/api-files.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ src/share/api/lease6-update.json
6868
src/share/api/lease6-wipe.json
6969
src/share/api/lease6-write.json
7070
src/share/api/leases-reclaim.json
71-
src/share/api/libreload.json
7271
src/share/api/list-commands.json
7372
src/share/api/network4-add.json
7473
src/share/api/network4-del.json

doc/sphinx/arm/ctrl-channel.rst

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -537,31 +537,6 @@ returning client that previously used that lease. See :ref:`lease-affinity`
537537
for details. Also, see :ref:`lease-reclamation` for general
538538
information about the processing of expired leases (lease reclamation).
539539

540-
.. isccmd:: libreload
541-
.. _command-libreload:
542-
543-
The ``libreload`` Command
544-
-------------------------
545-
546-
This command is now deprecated and will be removed in future Kea versions.
547-
548-
The :isccmd:`libreload` command first unloads and then loads all currently
549-
loaded hook libraries. This is primarily intended to allow one or more
550-
hook libraries to be replaced with newer versions, without requiring Kea
551-
servers to be reconfigured or restarted. The hook libraries
552-
are passed the same parameter values (if any) that were passed when they
553-
were originally loaded.
554-
555-
::
556-
557-
{
558-
"command": "libreload",
559-
"arguments": { }
560-
}
561-
562-
The server responds with a result of either 0, indicating success,
563-
or 1, indicating failure.
564-
565540
.. isccmd:: list-commands
566541
.. _command-list-commands:
567542

doc/sphinx/arm/install.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -650,11 +650,3 @@ Sysrepo 0.x or 1.x
650650
Kea 2.3.2 introduced support for Sysrepo 2.x. Unfortunately,
651651
Sysrepo continues to undergo major changes that are backward-incompatible,
652652
and current Kea versions do not support Sysrepo earlier than versions 2.x.
653-
654-
:isccmd:`libreload` command
655-
----------------------------------------
656-
657-
The :isccmd:`libreload` command was deprecated in Kea 2.3.4. The code to handle this command is
658-
still there, but there are reports of it being buggy and not really usable.
659-
Kea 2.3 and 2.4 versions produce a warning when this command
660-
is used, and it will be removed entirely sometime in the 2.5 branch.

src/bin/dhcp4/ctrl_dhcp4_srv.cc

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -228,43 +228,6 @@ ControlledDhcpv4Srv::commandShutdownHandler(const string&, ConstElementPtr args)
228228
return (createAnswer(CONTROL_RESULT_SUCCESS, "Shutting down."));
229229
}
230230

231-
ConstElementPtr
232-
ControlledDhcpv4Srv::commandLibReloadHandler(const string&, ConstElementPtr) {
233-
LOG_WARN(dhcp4_logger, DHCP4_DEPRECATED).arg("libreload command");
234-
235-
// stop thread pool (if running)
236-
MultiThreadingCriticalSection cs;
237-
238-
// Clear the packet queue.
239-
MultiThreadingMgr::instance().getThreadPool().reset();
240-
241-
try {
242-
/// Get list of currently loaded libraries and reload them.
243-
HookLibsCollection loaded = HooksManager::getLibraryInfo();
244-
HooksManager::prepareUnloadLibraries();
245-
static_cast<void>(HooksManager::unloadLibraries());
246-
IOServiceMgr::instance().clearIOServices();
247-
bool multi_threading_enabled = true;
248-
uint32_t thread_count = 0;
249-
uint32_t queue_size = 0;
250-
CfgMultiThreading::extract(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading(),
251-
multi_threading_enabled, thread_count, queue_size);
252-
bool status = HooksManager::loadLibraries(loaded, multi_threading_enabled);
253-
if (!status) {
254-
isc_throw(Unexpected, "Failed to reload hooks libraries "
255-
"(WARNING: libreload is deprecated).");
256-
}
257-
} catch (const std::exception& ex) {
258-
LOG_ERROR(dhcp4_logger, DHCP4_HOOKS_LIBS_RELOAD_FAIL);
259-
ConstElementPtr answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
260-
return (answer);
261-
}
262-
ConstElementPtr answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS,
263-
"Hooks libraries successfully reloaded "
264-
"(WARNING: libreload is deprecated).");
265-
return (answer);
266-
}
267-
268231
ConstElementPtr
269232
ControlledDhcpv4Srv::commandConfigReloadHandler(const string&,
270233
ConstElementPtr /*args*/) {
@@ -891,9 +854,6 @@ ControlledDhcpv4Srv::processCommand(const string& command,
891854
if (command == "shutdown") {
892855
return (srv->commandShutdownHandler(command, args));
893856

894-
} else if (command == "libreload") {
895-
return (srv->commandLibReloadHandler(command, args));
896-
897857
} else if (command == "config-reload") {
898858
return (srv->commandConfigReloadHandler(command, args));
899859

@@ -1235,9 +1195,6 @@ ControlledDhcpv4Srv::ControlledDhcpv4Srv(uint16_t server_port /*= DHCP4_SERVER_P
12351195
CommandMgr::instance().registerCommand("dhcp-disable",
12361196
std::bind(&ControlledDhcpv4Srv::commandDhcpDisableHandler, this, ph::_1, ph::_2));
12371197

1238-
CommandMgr::instance().registerCommand("libreload",
1239-
std::bind(&ControlledDhcpv4Srv::commandLibReloadHandler, this, ph::_1, ph::_2));
1240-
12411198
CommandMgr::instance().registerCommand("leases-reclaim",
12421199
std::bind(&ControlledDhcpv4Srv::commandLeasesReclaimHandler, this, ph::_1, ph::_2));
12431200

@@ -1322,7 +1279,6 @@ ControlledDhcpv4Srv::~ControlledDhcpv4Srv() {
13221279
CommandMgr::instance().deregisterCommand("dhcp-disable");
13231280
CommandMgr::instance().deregisterCommand("dhcp-enable");
13241281
CommandMgr::instance().deregisterCommand("leases-reclaim");
1325-
CommandMgr::instance().deregisterCommand("libreload");
13261282
CommandMgr::instance().deregisterCommand("server-tag-get");
13271283
CommandMgr::instance().deregisterCommand("shutdown");
13281284
CommandMgr::instance().deregisterCommand("statistic-get");

src/bin/dhcp4/ctrl_dhcp4_srv.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ class ControlledDhcpv4Srv : public isc::dhcp::Dhcpv4Srv {
8181
///
8282
/// Currently supported commands are:
8383
/// - shutdown
84-
/// - libreload
8584
/// - config-reload
8685
/// - config-set
8786
/// - config-get
@@ -168,19 +167,6 @@ class ControlledDhcpv4Srv : public isc::dhcp::Dhcpv4Srv {
168167
commandShutdownHandler(const std::string& command,
169168
isc::data::ConstElementPtr args);
170169

171-
/// @brief Handler for processing 'libreload' command
172-
///
173-
/// This handler processes libreload command, which unloads all hook
174-
/// libraries and reloads them.
175-
///
176-
/// @param command (parameter ignored)
177-
/// @param args (parameter ignored)
178-
///
179-
/// @return status of the command
180-
isc::data::ConstElementPtr
181-
commandLibReloadHandler(const std::string& command,
182-
isc::data::ConstElementPtr args);
183-
184170
/// @brief Handler for processing 'config-reload' command
185171
///
186172
/// This handler processes config-reload command, which processes

src/bin/dhcp4/dhcp4_messages.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ extern const isc::log::MessageID DHCP4_EMPTY_HOSTNAME = "DHCP4_EMPTY_HOSTNAME";
7777
extern const isc::log::MessageID DHCP4_FLEX_ID = "DHCP4_FLEX_ID";
7878
extern const isc::log::MessageID DHCP4_GENERATE_FQDN = "DHCP4_GENERATE_FQDN";
7979
extern const isc::log::MessageID DHCP4_HANDLE_SIGNAL_EXCEPTION = "DHCP4_HANDLE_SIGNAL_EXCEPTION";
80-
extern const isc::log::MessageID DHCP4_HOOKS_LIBS_RELOAD_FAIL = "DHCP4_HOOKS_LIBS_RELOAD_FAIL";
8180
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_RCVD_DROP = "DHCP4_HOOK_BUFFER_RCVD_DROP";
8281
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_RCVD_SKIP = "DHCP4_HOOK_BUFFER_RCVD_SKIP";
8382
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_SEND_SKIP = "DHCP4_HOOK_BUFFER_SEND_SKIP";
@@ -266,7 +265,6 @@ const char* values[] = {
266265
"DHCP4_FLEX_ID", "%1: flexible identifier generated for incoming packet: %2",
267266
"DHCP4_GENERATE_FQDN", "%1: client did not send a FQDN or hostname; FQDN will be generated for the client",
268267
"DHCP4_HANDLE_SIGNAL_EXCEPTION", "An exception was thrown while handing signal: %1",
269-
"DHCP4_HOOKS_LIBS_RELOAD_FAIL", "reload of hooks libraries failed",
270268
"DHCP4_HOOK_BUFFER_RCVD_DROP", "received buffer from %1 to %2 over interface %3 was dropped because a callout set the drop flag",
271269
"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.",
272270
"DHCP4_HOOK_BUFFER_SEND_SKIP", "%1: prepared response is dropped because a callout set the next step to SKIP.",

src/bin/dhcp4/dhcp4_messages.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ extern const isc::log::MessageID DHCP4_EMPTY_HOSTNAME;
7878
extern const isc::log::MessageID DHCP4_FLEX_ID;
7979
extern const isc::log::MessageID DHCP4_GENERATE_FQDN;
8080
extern const isc::log::MessageID DHCP4_HANDLE_SIGNAL_EXCEPTION;
81-
extern const isc::log::MessageID DHCP4_HOOKS_LIBS_RELOAD_FAIL;
8281
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_RCVD_DROP;
8382
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_RCVD_SKIP;
8483
extern const isc::log::MessageID DHCP4_HOOK_BUFFER_SEND_SKIP;

src/bin/dhcp4/dhcp4_messages.mes

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,6 @@ create DNS entries for unsophisticated clients.
413413
This error message is printed when an ISC or standard exception was raised during signal
414414
processing. This likely indicates a coding error and should be reported to ISC.
415415

416-
% DHCP4_HOOKS_LIBS_RELOAD_FAIL reload of hooks libraries failed
417-
A "libreload" command was issued to reload the hooks libraries but for
418-
some reason the reload failed. Other error messages issued from the
419-
hooks framework will indicate the nature of the problem.
420-
421416
% DHCP4_HOOK_BUFFER_RCVD_DROP received buffer from %1 to %2 over interface %3 was dropped because a callout set the drop flag
422417
This debug message is printed when a callout installed on buffer4_receive
423418
hook point set the drop flag. For this particular hook point, the

src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -448,96 +448,6 @@ TEST_F(CtrlChannelDhcpv4SrvTest, commands) {
448448
EXPECT_EQ(77, server_->getExitValue());
449449
}
450450

451-
// Check that the "libreload" command will reload libraries
452-
TEST_F(CtrlChannelDhcpv4SrvTest, libreload) {
453-
createUnixChannelServer();
454-
455-
// Ensure no marker files to start with.
456-
ASSERT_FALSE(checkMarkerFileExists(LOAD_MARKER_FILE));
457-
ASSERT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
458-
459-
// Load two libraries
460-
HookLibsCollection libraries;
461-
libraries.push_back(make_pair(CALLOUT_LIBRARY_1, ConstElementPtr()));
462-
HooksManager::loadLibraries(libraries);
463-
464-
// Check they are loaded.
465-
HookLibsCollection loaded_libraries =
466-
HooksManager::getLibraryInfo();
467-
ASSERT_TRUE(libraries == loaded_libraries);
468-
469-
EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "1"));
470-
EXPECT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
471-
472-
// Now execute the "libreload" command. This should cause the libraries
473-
// to unload and to reload.
474-
std::string response;
475-
sendUnixCommand("{ \"command\": \"libreload\" }", response);
476-
EXPECT_EQ("{ \"result\": 0, "
477-
"\"text\": \"Hooks libraries successfully reloaded "
478-
"(WARNING: libreload is deprecated).\" }"
479-
, response);
480-
481-
// Check that the libraries have unloaded and reloaded. The libraries are
482-
// unloaded in the reverse order to which they are loaded. When they load,
483-
// they should append information to the loading marker file.
484-
EXPECT_TRUE(checkMarkerFile(UNLOAD_MARKER_FILE, "1"));
485-
EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "11"));
486-
}
487-
488-
// Check that the "libreload" command will fail to reload libraries which are
489-
// not compatible when multi-threading is enabled
490-
TEST_F(CtrlChannelDhcpv4SrvTest, libreloadFailMultiThreading) {
491-
createUnixChannelServer();
492-
493-
// Ensure no marker files to start with.
494-
ASSERT_FALSE(checkMarkerFileExists(LOAD_MARKER_FILE));
495-
ASSERT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
496-
497-
// Disable multi-threading to temporarily trick the hook manager
498-
// into loading single-threaded libraries.
499-
MultiThreadingMgr::instance().setMode(false);
500-
501-
// Load two libraries
502-
HookLibsCollection libraries;
503-
libraries.push_back(make_pair(CALLOUT_LIBRARY_1, ConstElementPtr()));
504-
libraries.push_back(make_pair(CALLOUT_LIBRARY_2, ConstElementPtr()));
505-
HooksManager::loadLibraries(libraries);
506-
507-
// Check they are loaded.
508-
HookLibsCollection loaded_libraries =
509-
HooksManager::getLibraryInfo();
510-
ASSERT_TRUE(libraries == loaded_libraries);
511-
512-
// ... which also included checking that the marker file created by the
513-
// load functions exists and holds the correct value (of "12" - the
514-
// first library appends "1" to the file, the second appends "2"). Also
515-
// check that the unload marker file does not yet exist.
516-
EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "12"));
517-
EXPECT_FALSE(checkMarkerFileExists(UNLOAD_MARKER_FILE));
518-
519-
// Enable multi-threading before libreload command which should now fail
520-
// as the second library is not multi-threading compatible.
521-
MultiThreadingMgr::instance().setMode(true);
522-
523-
// Now execute the "libreload" command. This should cause the libraries
524-
// to unload and to reload.
525-
std::string response;
526-
sendUnixCommand("{ \"command\": \"libreload\" }", response);
527-
EXPECT_EQ("{ \"result\": 1, "
528-
"\"text\": \"Failed to reload hooks libraries"
529-
" (WARNING: libreload is deprecated).\" }"
530-
, response);
531-
532-
// Check that the libraries have unloaded and failed to reload. The
533-
// libraries are unloaded in the reverse order to which they are loaded.
534-
// When they load, they should append information to the loading marker
535-
// file. Failing to load the second library will also unload the first
536-
// library.
537-
EXPECT_TRUE(checkMarkerFile(UNLOAD_MARKER_FILE, "211"));
538-
EXPECT_TRUE(checkMarkerFile(LOAD_MARKER_FILE, "121"));
539-
}
540-
541451
// This test checks which commands are registered by the DHCPv4 server.
542452
TEST_F(CtrlChannelDhcpv4SrvTest, commandsRegistration) {
543453

@@ -570,7 +480,6 @@ TEST_F(CtrlChannelDhcpv4SrvTest, commandsRegistration) {
570480
EXPECT_TRUE(command_list.find("\"config-set\"") != string::npos);
571481
EXPECT_TRUE(command_list.find("\"config-write\"") != string::npos);
572482
EXPECT_TRUE(command_list.find("\"leases-reclaim\"") != string::npos);
573-
EXPECT_TRUE(command_list.find("\"libreload\"") != string::npos);
574483
EXPECT_TRUE(command_list.find("\"server-tag-get\"") != string::npos);
575484
EXPECT_TRUE(command_list.find("\"shutdown\"") != string::npos);
576485
EXPECT_TRUE(command_list.find("\"statistic-get\"") != string::npos);
@@ -1509,7 +1418,6 @@ TEST_F(CtrlChannelDhcpv4SrvTest, listCommands) {
15091418
checkListCommands(rsp, "config-write");
15101419
checkListCommands(rsp, "list-commands");
15111420
checkListCommands(rsp, "leases-reclaim");
1512-
checkListCommands(rsp, "libreload");
15131421
checkListCommands(rsp, "version-get");
15141422
checkListCommands(rsp, "server-tag-get");
15151423
checkListCommands(rsp, "shutdown");

src/bin/dhcp6/ctrl_dhcp6_srv.cc

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -231,43 +231,6 @@ ControlledDhcpv6Srv::commandShutdownHandler(const string&, ConstElementPtr args)
231231
return (createAnswer(CONTROL_RESULT_SUCCESS, "Shutting down."));
232232
}
233233

234-
ConstElementPtr
235-
ControlledDhcpv6Srv::commandLibReloadHandler(const string&, ConstElementPtr) {
236-
LOG_WARN(dhcp6_logger, DHCP6_DEPRECATED).arg("libreload command");
237-
238-
// stop thread pool (if running)
239-
MultiThreadingCriticalSection cs;
240-
241-
// Clear the packet queue.
242-
MultiThreadingMgr::instance().getThreadPool().reset();
243-
244-
try {
245-
/// Get list of currently loaded libraries and reload them.
246-
HookLibsCollection loaded = HooksManager::getLibraryInfo();
247-
HooksManager::prepareUnloadLibraries();
248-
static_cast<void>(HooksManager::unloadLibraries());
249-
IOServiceMgr::instance().clearIOServices();
250-
bool multi_threading_enabled = true;
251-
uint32_t thread_count = 0;
252-
uint32_t queue_size = 0;
253-
CfgMultiThreading::extract(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading(),
254-
multi_threading_enabled, thread_count, queue_size);
255-
bool status = HooksManager::loadLibraries(loaded, multi_threading_enabled);
256-
if (!status) {
257-
isc_throw(Unexpected, "Failed to reload hooks libraries "
258-
"(WARNING: libreload is deprecated).");
259-
}
260-
} catch (const std::exception& ex) {
261-
LOG_ERROR(dhcp6_logger, DHCP6_HOOKS_LIBS_RELOAD_FAIL);
262-
ConstElementPtr answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
263-
return (answer);
264-
}
265-
ConstElementPtr answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS,
266-
"Hooks libraries successfully reloaded "
267-
"(WARNING: libreload is deprecated).");
268-
return (answer);
269-
}
270-
271234
ConstElementPtr
272235
ControlledDhcpv6Srv::commandConfigReloadHandler(const string&,
273236
ConstElementPtr /*args*/) {
@@ -896,9 +859,6 @@ ControlledDhcpv6Srv::processCommand(const string& command,
896859
if (command == "shutdown") {
897860
return (srv->commandShutdownHandler(command, args));
898861

899-
} else if (command == "libreload") {
900-
return (srv->commandLibReloadHandler(command, args));
901-
902862
} else if (command == "config-reload") {
903863
return (srv->commandConfigReloadHandler(command, args));
904864

@@ -1258,9 +1218,6 @@ ControlledDhcpv6Srv::ControlledDhcpv6Srv(uint16_t server_port /*= DHCP6_SERVER_P
12581218
CommandMgr::instance().registerCommand("dhcp-disable",
12591219
std::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler, this, ph::_1, ph::_2));
12601220

1261-
CommandMgr::instance().registerCommand("libreload",
1262-
std::bind(&ControlledDhcpv6Srv::commandLibReloadHandler, this, ph::_1, ph::_2));
1263-
12641221
CommandMgr::instance().registerCommand("leases-reclaim",
12651222
std::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler, this, ph::_1, ph::_2));
12661223

@@ -1345,7 +1302,6 @@ ControlledDhcpv6Srv::~ControlledDhcpv6Srv() {
13451302
CommandMgr::instance().deregisterCommand("dhcp-disable");
13461303
CommandMgr::instance().deregisterCommand("dhcp-enable");
13471304
CommandMgr::instance().deregisterCommand("leases-reclaim");
1348-
CommandMgr::instance().deregisterCommand("libreload");
13491305
CommandMgr::instance().deregisterCommand("server-tag-get");
13501306
CommandMgr::instance().deregisterCommand("shutdown");
13511307
CommandMgr::instance().deregisterCommand("statistic-get");

0 commit comments

Comments
 (0)