]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
get a fresh copy of the zone after reload
authorKees Monshouwer <mind04@monshouwer.org>
Wed, 17 Sep 2014 06:44:31 +0000 (08:44 +0200)
committermind04 <mind04@monshouwer.org>
Wed, 17 Sep 2014 07:51:30 +0000 (09:51 +0200)
modules/bindbackend/bindbackend2.cc
regression-tests/tests/bind-add-zone/command
regression-tests/tests/bind-add-zone/expected_result.bind

index 28e38f1f046475be50b8f9febc4641d8f9e97766..cc5f3cf8c508659a06930eefe70d586b2bfc1de4 100644 (file)
@@ -681,7 +681,7 @@ void Bind2Backend::fixupAuth(shared_ptr<recordstorage_t> records)
 
 void Bind2Backend::doEmptyNonTerminals(BB2DomainInfo& bbd, bool nsec3zone, NSEC3PARAMRecordContent ns3pr)
 {
-  shared_ptr<recordstorage_t> records = bbd.d_records.getWRITABLE();
+  shared_ptr<const recordstorage_t> records = bbd.d_records.get();
   bool auth, doent=true;
   set<string> qnames;
   map<string, bool> nonterm;
@@ -1076,7 +1076,8 @@ void Bind2Backend::lookup(const QType &qtype, const string &qname, DNSPacket *pk
   if(!bbd.current()) {
     L<<Logger::Warning<<"Zone '"<<bbd.d_name<<"' ("<<bbd.d_filename<<") needs reloading"<<endl;
     queueReloadAndStore(bbd.d_id);
-    throw DBException("Zone for '"+bbd.d_name+"' in '"+bbd.d_filename+"' being reloaded"); // if we don't throw here, we crash for some reason
+    if (!safeGetBBDomainInfo(domain, &bbd))
+      throw DBException("Zone '"+bbd.d_name+"' ("+bbd.d_filename+") gone after reload"); // if we don't throw here, we crash for some reason
   }
 
   d_handle.d_records = bbd.d_records.get();
index d4a84686b3e73d7cd6e3523a037288fb1ef5bda8..98283fcc020cef0a45eb21c8dadcd1d70ed406be 100755 (executable)
@@ -12,6 +12,4 @@ sleep 1
 ../pdns/pdns_control --config-name=bind --socket-dir=. --no-config bind-add-zone addzone.com zones/addzone.com
 sleep 1
 cleandig ns1.addzone.com A
-sleep 1
-cleandig ns1.addzone.com A
 cleandig ns1.test.com A
index 067a1fdf4def8639bada7ce5f4c719dd01f6a5d4..f4e9915e217f582e75f9171eb327f1a8387e179b 100644 (file)
@@ -32,8 +32,6 @@ Reply to question for qname='ns1.test.com.', qtype=A
 Loaded zone addzone.com from zones/addzone.com
 0
 Already loaded
-Rcode: 2, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
-Reply to question for qname='ns1.addzone.com.', qtype=A
 0      ns1.addzone.com.        IN      A       3600    1.1.1.5
 Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
 Reply to question for qname='ns1.addzone.com.', qtype=A