2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

3157. [tuning] Reduce the time spent in "rndc reconfig" by parsing

the config file before pausing the server. [RT #21373]
This commit is contained in:
Evan Hunt
2011-09-23 18:08:01 +00:00
parent 6921f2d4ee
commit 1219f8d194
2 changed files with 14 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
3157. [tuning] Reduce the time spent in "rndc reconfig" by parsing
the config file before pausing the server. [RT #21373]
3156. [placeholder] 3156. [placeholder]
--- 9.9.0a2 released --- --- 9.9.0a2 released ---

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: server.c,v 1.619 2011/09/06 22:29:32 smann Exp $ */ /* $Id: server.c,v 1.620 2011/09/23 18:08:01 each Exp $ */
/*! \file */ /*! \file */
@@ -4341,15 +4341,12 @@ load_configuration(const char *filename, ns_server_t *server,
ns_cache_t *nsc; ns_cache_t *nsc;
struct cfg_context *nzctx; struct cfg_context *nzctx;
int num_zones = 0; int num_zones = 0;
isc_boolean_t exclusive = ISC_FALSE;
ISC_LIST_INIT(viewlist); ISC_LIST_INIT(viewlist);
ISC_LIST_INIT(builtin_viewlist); ISC_LIST_INIT(builtin_viewlist);
ISC_LIST_INIT(cachelist); ISC_LIST_INIT(cachelist);
/* Ensure exclusive access to configuration data. */
result = isc_task_beginexclusive(server->task);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
/* Create the ACL configuration context */ /* Create the ACL configuration context */
if (ns_g_aclconfctx != NULL) if (ns_g_aclconfctx != NULL)
cfg_aclconfctx_detach(&ns_g_aclconfctx); cfg_aclconfctx_detach(&ns_g_aclconfctx);
@@ -4445,6 +4442,13 @@ load_configuration(const char *filename, ns_server_t *server,
CHECK(result); CHECK(result);
} }
/* Ensure exclusive access to configuration data. */
if (!exclusive) {
result = isc_task_beginexclusive(server->task);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
exclusive = ISC_TRUE;
}
/* /*
* Set process limits, which (usually) needs to be done as root. * Set process limits, which (usually) needs to be done as root.
*/ */
@@ -5212,7 +5216,8 @@ load_configuration(const char *filename, ns_server_t *server,
adjust_interfaces(server, ns_g_mctx); adjust_interfaces(server, ns_g_mctx);
/* Relinquish exclusive access to configuration data. */ /* Relinquish exclusive access to configuration data. */
isc_task_endexclusive(server->task); if (exclusive)
isc_task_endexclusive(server->task);
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
ISC_LOG_DEBUG(1), "load_configuration: %s", ISC_LOG_DEBUG(1), "load_configuration: %s",