[master] don't go nonresponsive during "rndc reload"

3617.	[bug]		Named was failing to answer queries during
			"rndc reload" [RT #34098]
This commit is contained in:
Evan Hunt 2013-07-11 10:51:19 -07:00
parent cf0a69e999
commit 964bdcd7ad
3 changed files with 22 additions and 11 deletions

View file

@ -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

View 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,

View 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`