]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] don't go nonresponsive during "rndc reload"
authorEvan Hunt <each@isc.org>
Thu, 11 Jul 2013 17:51:19 +0000 (10:51 -0700)
committerEvan Hunt <each@isc.org>
Thu, 11 Jul 2013 17:54:21 +0000 (10:54 -0700)
3617. [bug] Named was failing to answer queries during
"rndc reload" [RT #34098]

CHANGES
bin/named/server.c
bin/tests/system/redirect/tests.sh

diff --git a/CHANGES b/CHANGES
index d586ef25937fafc48b76eb45fd731e487a08fa93..d21d98c2ddee5d5f0e014bbd5768bd0cca06c948 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3617.  [bug]           Named was failing to answer queries during
+                       "rndc reload" [RT #34098]
+
 3616.  [bug]           Change #3613 was incomplete. [RT #34177]
 
 3615.  [cleanup]       "configure" now finishes by printing a summary
index f0de910ed41e8f56e07a8567071f494b0f9eb410..7e02fa5703a2cd0cd5f1bc52fe782d79822a107b 100644 (file)
@@ -5929,7 +5929,7 @@ view_loaded(void *arg) {
 }
 
 static isc_result_t
-load_zones(ns_server_t *server) {
+load_zones(ns_server_t *server, isc_boolean_t init) {
        isc_result_t result;
        dns_view_t *view;
        ns_zoneload_t *zl;
@@ -5980,12 +5980,14 @@ load_zones(ns_server_t *server) {
        if (refs == 0) {
                isc_refcount_destroy(&zl->refs);
                isc_mem_put(server->mctx, zl, sizeof (*zl));
-       } else {
+       } else if (init) {
                /*
                 * Place the task manager into privileged mode.  This
                 * ensures that after we leave task-exclusive mode, no
                 * other tasks will be able to run except for the ones
-                * that are loading zones.
+                * that are loading zones. (This should only be done during
+                * the initial server setup; it isn't necessary during
+                * a reload.)
                 */
                isc_taskmgr_setmode(ns_g_taskmgr, isc_taskmgrmode_privileged);
        }
@@ -6077,7 +6079,7 @@ run_server(isc_task_t *task, isc_event_t *event) {
 
        isc_hash_init();
 
-       CHECKFATAL(load_zones(server), "loading zones");
+       CHECKFATAL(load_zones(server, ISC_TRUE), "loading zones");
 }
 
 void
@@ -6525,7 +6527,7 @@ reload(ns_server_t *server) {
        isc_result_t result;
        CHECK(loadconfig(server));
 
-       result = load_zones(server);
+       result = load_zones(server, ISC_FALSE);
        if (result == ISC_R_SUCCESS)
                isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
                              NS_LOGMODULE_SERVER, ISC_LOG_INFO,
index a51f58b341b9bae33b07a2424aa6a55f570f5aa8..7b83fecda8e709da67ed55460a19c421d1ab97d2 100644 (file)
@@ -338,12 +338,18 @@ sed -e 's/0 0 0 0 0/1 0 0 0 0/' < ns2/example.db.in > ns2/example.db
 sed -e 's/0 0 0 0 0/1 0 0 0 0/' -e 's/\.1$/.2/' < ns2/redirect.db.in > ns2/redirect.db
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload > rndc.out || ret=1
 sed 's/^/I:ns2 /' rndc.out
-$DIG $DIGOPTS +short @10.53.0.2 soa example.nil > dig.out.ns1.test$n || ret=1
-set -- `cat dig.out.ns1.test$n`
-[ $3 = 1 ] || ret=1
-$DIG $DIGOPTS nonexist. @10.53.0.2 -b 10.53.0.2 a > dig.out.ns2.test$n || ret=1
-grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
-grep "100.100.100.2" dig.out.ns2.test$n > /dev/null || ret=1
+for i in 1 2 3 4 5 6 7 8 9; do
+    tmp=0
+    $DIG $DIGOPTS +short @10.53.0.2 soa example.nil > dig.out.ns1.test$n || tmp=1
+    set -- `cat dig.out.ns1.test$n`
+    [ $3 = 1 ] || tmp=1
+    $DIG $DIGOPTS nonexist. @10.53.0.2 -b 10.53.0.2 a > dig.out.ns2.test$n || tmp=1
+    grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || tmp=1
+    grep "100.100.100.2" dig.out.ns2.test$n > /dev/null || tmp=1
+    [ $tmp -eq 0 ] && break
+    sleep 1
+done
+[ $tmp -eq 1 ] && ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`