From: Razvan Becheriu Date: Wed, 18 Mar 2020 14:48:11 +0000 (+0200) Subject: [#893] addressed review X-Git-Tag: Kea-1.7.6~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02d802a50d53ca171812522d76dc644c0e079f5d;p=thirdparty%2Fkea.git [#893] addressed review --- diff --git a/ChangeLog b/ChangeLog index 14be42c3ad..f662ba677c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +1730. [func] razvan + Added -N command line switch that enables experimental multi-threading + support. Number of threads can be specified (e.g. -N8) or Kea can be + told to autodetect number of CPU threads (-N0). This feature is + experimental. It hasn't been tested extensively and is known to cause + problems with DDNS and HA. Do not use in production! + (Gitlab #893) + 1729. [func] razvan The RAII MultiThreadingCriticalSection class is now able to automatically stop and start the packet thread pool in order to diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index 4961ba2800..c6e6bac887 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -169,7 +169,6 @@ ControlledDhcpv4Srv::loadConfigFile(const std::string& file_name) { "processCommand(\"config-set\", json)"); } - // @todo enable multi-threading - disabled for now bool enabled = false; if (srv_thread_count >= 0) { enabled = true; diff --git a/src/bin/dhcp4/dhcp4_messages.cc b/src/bin/dhcp4/dhcp4_messages.cc index 6e72597bde..2d51a7ff49 100644 --- a/src/bin/dhcp4/dhcp4_messages.cc +++ b/src/bin/dhcp4/dhcp4_messages.cc @@ -1,4 +1,4 @@ -// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Mon Mar 16 2020 18:32 +// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Wed Mar 18 2020 16:28 #include #include @@ -226,7 +226,7 @@ const char* values[] = { "DHCP4_LEASE_ADVERT", "%1: lease %2 will be advertised", "DHCP4_LEASE_ALLOC", "%1: lease %2 has been allocated for %3 seconds", "DHCP4_MULTI_THREADING_INFO", "enabled: %1, number of threads: %2, queue size per thread: %3", - "DHCP4_MULTI_THREADING_WARNING", "multi-threading support is experimental. Don't use in production environment.", + "DHCP4_MULTI_THREADING_WARNING", "The multi-threading feature is experimental. Don't use in production environment.", "DHCP4_NCR_CREATE", "%1: DDNS updates enabled, therefore sending name change requests", "DHCP4_NCR_CREATION_FAILED", "%1: failed to generate name change requests for DNS: %2", "DHCP4_NOT_RUNNING", "DHCPv4 server is not running", diff --git a/src/bin/dhcp4/dhcp4_messages.h b/src/bin/dhcp4/dhcp4_messages.h index 7901f06885..a2efea1163 100644 --- a/src/bin/dhcp4/dhcp4_messages.h +++ b/src/bin/dhcp4/dhcp4_messages.h @@ -1,4 +1,4 @@ -// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Mon Mar 16 2020 18:32 +// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Wed Mar 18 2020 16:28 #ifndef DHCP4_MESSAGES_H #define DHCP4_MESSAGES_H diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index 7d6adc8385..45b65e9640 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -441,7 +441,7 @@ lifetime. This is a message listing some information about the multi-threading parameters with which the server is running. -% DHCP4_MULTI_THREADING_WARNING multi-threading support is experimental. Don't use in production environment. +% DHCP4_MULTI_THREADING_WARNING The multi-threading feature is experimental. Don't use in production environment. This is a message warning about the experimental multi-threading feature. % DHCP4_NCR_CREATE %1: DDNS updates enabled, therefore sending name change requests diff --git a/src/bin/dhcp4/main.cc b/src/bin/dhcp4/main.cc index 5978ce67c5..98d3b40fb7 100644 --- a/src/bin/dhcp4/main.cc +++ b/src/bin/dhcp4/main.cc @@ -48,7 +48,7 @@ usage() { cerr << "Kea DHCPv4 server, version " << VERSION << endl; cerr << endl; cerr << "Usage: " << DHCP4_NAME - << " -[v|V|W] [-d] [-{c|t} cfgfile] [-p number] [-P number]" << endl; + << " -[v|V|W] [-d] [-{c|t} cfgfile] [-p number] [-P number] [-N number]" << endl; cerr << " -v: print version number and exit" << endl; cerr << " -V: print extended version and exit" << endl; cerr << " -W: display the configuration report and exit" << endl; diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index 41f9dcd2a8..3929b86b1c 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -140,7 +140,6 @@ ControlledDhcpv6Srv::loadConfigFile(const std::string& file_name) { "processCommand(\"config-set\", json)"); } - // @todo enable multi-threading - disabled for now bool enabled = false; if (srv_thread_count >= 0) { enabled = true; diff --git a/src/bin/dhcp6/dhcp6_messages.cc b/src/bin/dhcp6/dhcp6_messages.cc index 14249f275d..803f233a17 100644 --- a/src/bin/dhcp6/dhcp6_messages.cc +++ b/src/bin/dhcp6/dhcp6_messages.cc @@ -1,4 +1,4 @@ -// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Mon Mar 16 2020 18:36 +// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Wed Mar 18 2020 16:30 #include #include @@ -230,7 +230,7 @@ const char* values[] = { "DHCP6_LEASE_PD_WITHOUT_DUID", "%1: lease for prefix %2/%3 does not have a DUID", "DHCP6_LEASE_RENEW", "%1: lease for address %2 and iaid=%3 has been allocated", "DHCP6_MULTI_THREADING_INFO", "enabled: %1, number of threads: %2, queue size per thread: %3", - "DHCP6_MULTI_THREADING_WARNING", "multi-threading support is experimental. Don't use in production environment.", + "DHCP6_MULTI_THREADING_WARNING", "The multi-threading feature is experimental. Don't use in production environment.", "DHCP6_NOT_RUNNING", "IPv6 DHCP server is not running", "DHCP6_NO_INTERFACES", "failed to detect any network interfaces", "DHCP6_NO_SOCKETS_OPEN", "no interface configured to listen to DHCP traffic", diff --git a/src/bin/dhcp6/dhcp6_messages.h b/src/bin/dhcp6/dhcp6_messages.h index 743c205c5e..e044c65e7f 100644 --- a/src/bin/dhcp6/dhcp6_messages.h +++ b/src/bin/dhcp6/dhcp6_messages.h @@ -1,4 +1,4 @@ -// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Mon Mar 16 2020 18:36 +// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Wed Mar 18 2020 16:30 #ifndef DHCP6_MESSAGES_H #define DHCP6_MESSAGES_H diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index dbeb73c321..a074a6379e 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -488,7 +488,7 @@ IAID. This is a message listing some information about the multi-threading parameters with which the server is running. -% DHCP6_MULTI_THREADING_WARNING multi-threading support is experimental. Don't use in production environment. +% DHCP6_MULTI_THREADING_WARNING The multi-threading feature is experimental. Don't use in production environment. This is a message warning about the experimental multi-threading feature. % DHCP6_NOT_RUNNING IPv6 DHCP server is not running diff --git a/src/bin/dhcp6/main.cc b/src/bin/dhcp6/main.cc index 98cb461dfd..2f8b5940a4 100644 --- a/src/bin/dhcp6/main.cc +++ b/src/bin/dhcp6/main.cc @@ -48,7 +48,7 @@ usage() { cerr << "Kea DHCPv6 server, version " << VERSION << endl; cerr << endl; cerr << "Usage: " << DHCP6_NAME - << " -[v|V|W] [-d] [-{c|t} cfgfile] [-p number] [-P number]" << endl; + << " -[v|V|W] [-d] [-{c|t} cfgfile] [-p number] [-P number] [-N number]" << endl; cerr << " -v: print version number and exit." << endl; cerr << " -V: print extended version and exit" << endl; cerr << " -W: display the configuration report and exit" << endl;