From a6ae1d61942d2108ff74cae99e41e0de350f2931 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 12 Nov 2007 13:58:34 +0000 Subject: [PATCH] - bugreports to unbound-bugs@nlnetlabs.nl - fixup testbound so it exits cleanly. - cleanup the caches on a reload, so that rrsetID numbers won't clash. git-svn-id: file:///svn/unbound/trunk@740 be551aaa-1e26-0410-a405-d3ace91eadb9 --- configure | 30 +++++++++++++++--------------- configure.ac | 2 +- daemon/daemon.c | 7 +++++++ doc/Changelog | 3 +++ doc/README | 2 +- doc/example.conf | 1 + doc/unbound.conf.5 | 1 + services/cache/rrset.c | 1 - testcode/fake_event.c | 12 +++++++++--- testcode/replay.h | 2 ++ 10 files changed, 40 insertions(+), 21 deletions(-) diff --git a/configure b/configure index 62a3ee779..9750302cc 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for unbound 0.6. # -# Report bugs to . +# Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -726,7 +726,7 @@ PACKAGE_NAME='unbound' PACKAGE_TARNAME='unbound' PACKAGE_VERSION='0.6' PACKAGE_STRING='unbound 0.6' -PACKAGE_BUGREPORT='wouter@nlnetlabs.nl' +PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl' # Factoring default headers for most tests. ac_includes_default="\ @@ -1483,7 +1483,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -5925,9 +5925,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >& { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to wouter@nlnetlabs.nl ## -## ---------------------------------- ## +## ---------------------------------------- ## +## Report this to unbound-bugs@nlnetlabs.nl ## +## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -22204,9 +22204,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >& { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to wouter@nlnetlabs.nl ## -## ---------------------------------- ## +## ---------------------------------------- ## +## Report this to unbound-bugs@nlnetlabs.nl ## +## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -22585,9 +22585,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >& { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to wouter@nlnetlabs.nl ## -## ---------------------------------- ## +## ---------------------------------------- ## +## Report this to unbound-bugs@nlnetlabs.nl ## +## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -22813,9 +22813,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >& { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to wouter@nlnetlabs.nl ## -## ---------------------------------- ## +## ---------------------------------------- ## +## Report this to unbound-bugs@nlnetlabs.nl ## +## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; diff --git a/configure.ac b/configure.ac index 454c4ee4c..7763c7b4b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(unbound, 0.6, wouter@nlnetlabs.nl, unbound) +AC_INIT(unbound, 0.6, unbound-bugs@nlnetlabs.nl, unbound) CFLAGS= AC_AIX diff --git a/daemon/daemon.c b/daemon/daemon.c index 7a59974ee..8108e850d 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -437,6 +437,13 @@ daemon_cleanup(struct daemon* daemon) don't die on multiple reload signals for example. */ signal_handling_record(); log_thread_set(NULL); + /* clean up caches because + * a) RRset IDs will be recycled after a reload, causing collisions + * b) validation config can change, thus rrset, msg, keycache clear + * The infra cache is kept, the timing and edns info is still valid */ + slabhash_clear(&daemon->env->rrset_cache->table); + slabhash_clear(daemon->env->msg_cache); + /* key cache is cleared by module desetup during next daemon_init() */ for(i=0; inum; i++) worker_delete(daemon->workers[i]); free(daemon->workers); diff --git a/doc/Changelog b/doc/Changelog index 42390527a..b2cadc875 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,9 @@ 12 November 2007: Wouter - fixup signal handling where SIGTERM could be ignored if a SIGHUP arrives later on. + - bugreports to unbound-bugs@nlnetlabs.nl + - fixup testbound so it exits cleanly. + - cleanup the caches on a reload, so that rrsetID numbers won't clash. 9 November 2007: Wouter - took ldns snapshot in repo. diff --git a/doc/README b/doc/README index e10eedc95..47eec9940 100644 --- a/doc/README +++ b/doc/README @@ -59,4 +59,4 @@ o Other code origins are from the NSD (NLnet Labs) and LDNS (NLnet Labs) projects. Such as buffer, region-allocator and red-black tree code. o See Credits file for contributors. -* mailto:wouter@nlnetlabs.nl +* mailto:unbound-bugs@nlnetlabs.nl diff --git a/doc/example.conf b/doc/example.conf index b88a8d50a..7684c849d 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -22,6 +22,7 @@ server: # The default is to listen to localhost (127.0.0.1 and ::1). # specify 0.0.0.0 and ::0 to bind to all available interfaces. # specify every interface on a new 'interface:' labelled line. + # The listen interfaces are not changed on reload, only on restart. # interface: 192.0.2.153 # interface: 192.0.2.154 # interface: 2001:DB8::5 diff --git a/doc/unbound.conf.5 b/doc/unbound.conf.5 index fdb0cdbe9..c45f4268a 100644 --- a/doc/unbound.conf.5 +++ b/doc/unbound.conf.5 @@ -79,6 +79,7 @@ Interface to use to connect to the network. This interface is listened to for queries from clients, and answers to clients are given from it. Can be given multiple times to work on several interfaces. If none are given the default is to listen to localhost. +The interfaces are not changed on a reload (kill -HUP) but only on restart. .It \fBoutgoing-interface:\fR Interface to use to connect to the network. This interface is used to send queries to authoritative servers and receive their replies. Can be given diff --git a/services/cache/rrset.c b/services/cache/rrset.c index f0cb341d4..f3cafdfef 100644 --- a/services/cache/rrset.c +++ b/services/cache/rrset.c @@ -248,7 +248,6 @@ rrset_array_lock(struct rrset_ref* ref, size_t count, uint32_t timenow) if(i>0 && ref[i].key == ref[i-1].key) continue; /* only lock items once */ lock_rw_rdlock(&ref[i].key->entry.lock); - log_assert(ref[i].id != 0 && ref[i].key->id != 0); if(ref[i].id != ref[i].key->id || timenow > ((struct packed_rrset_data*)(ref[i].key->entry.data)) ->ttl) { diff --git a/testcode/fake_event.c b/testcode/fake_event.c index ee6d0b86a..98e16bf9b 100644 --- a/testcode/fake_event.c +++ b/testcode/fake_event.c @@ -56,6 +56,7 @@ #include "testcode/replay.h" #include "testcode/ldns-testpkts.h" #include "util/log.h" +#include /** Global variable: the scenario. Saved here for when event_init is done. */ static struct replay_scenario* saved_scenario = NULL; @@ -522,6 +523,7 @@ run_scenario(struct replay_runtime* runtime) fatal_exit("testbound: there are unmatched answers."); } log_info("testbound: exiting fake runloop."); + runtime->exit_cleanly = 1; } /*********** Dummy routines ***********/ @@ -595,13 +597,17 @@ comm_base_dispatch(struct comm_base* b) { struct replay_runtime* runtime = (struct replay_runtime*)b; run_scenario(runtime); + (*runtime->sig_cb)(SIGTERM, runtime->sig_cb_arg); } void -comm_base_exit(struct comm_base* ATTR_UNUSED(b)) +comm_base_exit(struct comm_base* b) { - /* some sort of failure */ - fatal_exit("testbound: comm_base_exit was called."); + struct replay_runtime* runtime = (struct replay_runtime*)b; + if(!runtime->exit_cleanly) { + /* some sort of failure */ + fatal_exit("testbound: comm_base_exit was called."); + } } struct comm_signal* diff --git a/testcode/replay.h b/testcode/replay.h index ca68c885f..dcf67edd1 100644 --- a/testcode/replay.h +++ b/testcode/replay.h @@ -228,6 +228,8 @@ struct replay_runtime { void (*sig_cb)(int, void*); /** signal handler user arg */ void *sig_cb_arg; + /** time to exit cleanly */ + int exit_cleanly; /** size of buffers */ size_t bufsize; -- 2.47.2