]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2722] addressed comments
authorRazvan Becheriu <razvan@isc.org>
Fri, 17 Mar 2023 11:02:23 +0000 (13:02 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 17 Mar 2023 13:51:43 +0000 (15:51 +0200)
ChangeLog
src/bin/d2/d2_process.cc
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp6/json_config_parser.cc

index de208fcabe044a5f5bb1f1f68ae5d9e07b096ecf..a78b4b151f80c0e93b2fb89ec0325739600287c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,8 +4,8 @@
        previously working configuration if the new configuration is
        invalid. There are still cases that can leave the server in an
        unrecoverable state, and such case is indicated by a FATAL
-       log message. The same functinality applies to the "config-set"
-       command available to the server through the control channel.
+       log message. The same logic applies to the "config-set" command
+       available to the server through the control channel.
        (Gitlab #2722)
 
 2112.  [doc]           fdupont
index dc7dff89157fb128e24bfd758f1823535601c24e..48026c99c47e8b6f2c2764f68bdc201f627a3ecf 100644 (file)
@@ -232,7 +232,7 @@ D2Process::shutdown(isc::data::ConstElementPtr args) {
     // Set the base class's shutdown flag.
     setShutdownFlag(true);
     return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS,
-                                      "Shutdown initiated, type is: " +\
+                                      "Shutdown initiated, type is: " +
                                       type_str));
 }
 
index a602c7c98b16b5f90574584b2d9dd4ff058e827a..3d6c48ce41e31712ced3e06959dbd330c044e478 100644 (file)
@@ -767,6 +767,14 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
             string parameter_name;
             ElementPtr mutable_cfg;
 
+            // 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 and
+            // to properly drop any task items stored in the thread pool which
+            // might reference some handles to loaded hooks, preventing them
+            // from being unloaded.
+            MultiThreadingMgr::instance().apply(false, 0, 0);
+
             // Close DHCP sockets and remove any existing timers.
             IfaceMgr::instance().closeSockets();
             TimerMgr::instance()->unregisterTimers();
index 92cc046da76f5f5a7b6dd83852de43fc0f880ca1..58e691c0a8c7154eaeff71ca54b5a3532ba7b448 100644 (file)
@@ -896,6 +896,14 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
             string parameter_name;
             ElementPtr mutable_cfg;
 
+            // 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 and
+            // to properly drop any task items stored in the thread pool which
+            // might reference some handles to loaded hooks, preventing them
+            // from being unloaded.
+            MultiThreadingMgr::instance().apply(false, 0, 0);
+
             // Close DHCP sockets and remove any existing timers.
             IfaceMgr::instance().closeSockets();
             TimerMgr::instance()->unregisterTimers();