]> 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, 7 Oct 2011 04:41:30 +0000 (04:41 +0000)
committerEvan Hunt <each@isc.org>
Fri, 7 Oct 2011 04:41:30 +0000 (04:41 +0000)
the config file before pausing the server. [RT #21373]

CHANGES
bin/named/server.c

diff --git a/CHANGES b/CHANGES
index 2c797fac68aec7b78d78f8b56f4f1bb8abf7dd24..9bb3daa70d09b392996c31d41241c603f3c814ae 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.   [bug]           Reconfiguring the server with an incorrectly
                         formatted TSIG key could cause a crash during
                         subsequent zone transfers.  [RT #20391]
index 6683a1ee371e2d24d23438e568751954e3b2f4f3..8c7a86246c2833d454a9b2bcfd36a48cc08ae764 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.520.12.28 2011/09/23 00:37:28 each Exp $ */
+/* $Id: server.c,v 1.520.12.29 2011/10/07 04:41:30 each Exp $ */
 
 /*! \file */
 
@@ -3022,14 +3022,11 @@ load_configuration(const char *filename, ns_server_t *server,
        isc_uint32_t udpsize;
        unsigned int maxsocks;
        int num_zones = 0;
+       isc_boolean_t exclusive = ISC_FALSE;
 
        cfg_aclconfctx_init(&aclconfctx);
        ISC_LIST_INIT(viewlist);
 
-       /* Ensure exclusive access to configuration data. */
-       result = isc_task_beginexclusive(server->task);
-       RUNTIME_CHECK(result == ISC_R_SUCCESS);
-
        /*
         * Parse the global default pseudo-config file.
         */
@@ -3096,6 +3093,13 @@ load_configuration(const char *filename, ns_server_t *server,
        maps[i++] = ns_g_defaults;
        maps[i] = NULL;
 
+       /* 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.
         */
@@ -3807,7 +3811,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",