]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3157. [tuning] Reduce the time spent in "rndc reconfig" by parsing
authorEvan Hunt <each@isc.org>
Fri, 23 Sep 2011 18:08:01 +0000 (18:08 +0000)
committerEvan Hunt <each@isc.org>
Fri, 23 Sep 2011 18:08:01 +0000 (18:08 +0000)
the config file before pausing the server. [RT #21373]

CHANGES
bin/named/server.c

diff --git a/CHANGES b/CHANGES
index 1b138cfb51d6ffd4c31b5b8d1afdac721d733f14..aa3949b8976e1f377b3e0de710215b5b97b7508e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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]
 
        --- 9.9.0a2 released ---
index 7091c2acd7d6a1ec80921fdae085737dd9f82872..a15516a889e3fc118a377fbbb1ad025321ab50f8 100644 (file)
@@ -15,7 +15,7 @@
  * 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 */
 
@@ -4341,15 +4341,12 @@ load_configuration(const char *filename, ns_server_t *server,
        ns_cache_t *nsc;
        struct cfg_context *nzctx;
        int num_zones = 0;
+       isc_boolean_t exclusive = ISC_FALSE;
 
        ISC_LIST_INIT(viewlist);
        ISC_LIST_INIT(builtin_viewlist);
        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 */
        if (ns_g_aclconfctx != NULL)
                cfg_aclconfctx_detach(&ns_g_aclconfctx);
@@ -4445,6 +4442,13 @@ load_configuration(const char *filename, ns_server_t *server,
                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.
         */
@@ -5212,7 +5216,8 @@ load_configuration(const char *filename, ns_server_t *server,
                adjust_interfaces(server, ns_g_mctx);
 
        /* 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_DEBUG(1), "load_configuration: %s",