BIND 10 trac2204, updated. 1e93f1db983cc35b118853b88ab2919decafe2c5 [2204] grammar fix in documentation
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Oct 9 00:41:16 UTC 2012
The branch, trac2204 has been updated
via 1e93f1db983cc35b118853b88ab2919decafe2c5 (commit)
via 3a68ea2e8de8d6df97d95c077ff9e2874ca0d9c3 (commit)
via 4e159ffca0b633c817472101087be4a235a42af0 (commit)
from 86a4bae1ffa68eb38921d6cb3f16dad43b616009 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1e93f1db983cc35b118853b88ab2919decafe2c5
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Oct 8 17:29:15 2012 -0700
[2204] grammar fix in documentation
commit 3a68ea2e8de8d6df97d95c077ff9e2874ca0d9c3
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Oct 8 17:27:23 2012 -0700
[2204] updated test comments without using "rollback".
as the new code actually doesn't do rollback operation internally,
even though the observable effect is the same.
commit 4e159ffca0b633c817472101087be4a235a42af0
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Oct 8 16:56:10 2012 -0700
[2204] updated comments about releasing old data source client lists
the previous one was not really accurate and was confusing.
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/datasrc_config.h | 6 ++---
src/bin/auth/main.cc | 11 +++++----
src/bin/auth/tests/datasrc_config_unittest.cc | 30 ++++++++++++-------------
3 files changed, 23 insertions(+), 24 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/datasrc_config.h b/src/bin/auth/datasrc_config.h
index 842d2ca..02e4e5c 100644
--- a/src/bin/auth/datasrc_config.h
+++ b/src/bin/auth/datasrc_config.h
@@ -27,9 +27,9 @@
/// \brief Configure data source client lists
///
-/// This will hook into the data_sources module configuration and it return
-/// a new set (in the form of a shared pointer to map) of data source client
-/// lists corresponding to the configuration.
+/// This will hook into the data_sources module configuration and it will
+/// return a new set (in the form of a shared pointer to map) of data source
+/// client lists corresponding to the configuration.
///
/// This function is templated. This is simply because of easier testing.
/// You don't need to pay attention to it, use the configureDataSource
diff --git a/src/bin/auth/main.cc b/src/bin/auth/main.cc
index 1e3ca9c..9908066 100644
--- a/src/bin/auth/main.cc
+++ b/src/bin/auth/main.cc
@@ -109,17 +109,16 @@ datasrcConfigHandler(AuthSrv* server, bool* first_time,
lists = configureDataSource(config->get("classes"));
}
- // Replace the server's lists. By ignoring the return value we let the
- // old lists be destroyed. Lock will be released immediately after the
- // swap.
+ // Replace the server's lists. The returned lists will be stored
+ // in a local variable 'lists', and will be destroyed outside of
+ // the temporary block for the lock scope. That way we can minimize
+ // the range of the critical section.
{
isc::util::thread::Mutex::Locker locker(
server->getDataSrcClientListMutex());
lists = server->swapDataSrcClientLists(lists);
}
- // The previous lists are destroyed here. Note that it's outside
- // of the critical section protected by the locker. So this can
- // take time if running on a separate thread.
+ // The previous lists are destroyed here.
}
}
diff --git a/src/bin/auth/tests/datasrc_config_unittest.cc b/src/bin/auth/tests/datasrc_config_unittest.cc
index 97d89bf..877f921 100644
--- a/src/bin/auth/tests/datasrc_config_unittest.cc
+++ b/src/bin/auth/tests/datasrc_config_unittest.cc
@@ -244,10 +244,11 @@ TEST_F(DatasrcConfigTest, updateDelete) {
EXPECT_TRUE(lists_.empty());
}
-// Check that we can rollback an addition if something else fails
-TEST_F(DatasrcConfigTest, rollbackAddition) {
+// Check that broken new configuration doesn't break the running configuration.
+TEST_F(DatasrcConfigTest, brokenConfigForAdd) {
initializeINList();
- // The configuration is wrong. However, the CH one will get done first.
+ // The configuration is wrong. However, the CH one will be handled
+ // without an error first.
const ElementPtr
config(buildConfig("{\"IN\": [{\"type\": 13}], "
"\"CH\": [{\"type\": \"xxx\"}]}"));
@@ -263,8 +264,9 @@ TEST_F(DatasrcConfigTest, rollbackAddition) {
EXPECT_FALSE(lists_[RRClass::CH()]);
}
-// Check that we can rollback a deletion if something else fails
-TEST_F(DatasrcConfigTest, rollbackDeletion) {
+// Similar to the previous one, but the broken config would delete part of
+// the running config.
+TEST_F(DatasrcConfigTest, brokenConfigForDelete) {
initializeINList();
// Put the CH there
const ElementPtr
@@ -273,27 +275,25 @@ TEST_F(DatasrcConfigTest, rollbackDeletion) {
testConfigureDataSource(*this, config1);
const ElementPtr
config2(Element::fromJSON("{\"IN\": [{\"type\": 13}]}"));
- // This would delete CH. However, the IN one fails.
- // As the deletions happen after the additions/settings
- // and there's no known way to cause an exception during the
- // deletions, it is not a true rollback, but the result should
- // be the same.
+ // This would delete CH. However, the new config is broken, so it won't
+ // actually apply.
EXPECT_THROW(testConfigureDataSource(*this, config2), TypeError);
EXPECT_EQ("yyy", lists_[RRClass::IN()]->getConf());
EXPECT_EQ("xxx", lists_[RRClass::CH()]->getConf());
}
-// Check that we can roll back configuration change if something
-// fails later on.
-TEST_F(DatasrcConfigTest, rollbackConfiguration) {
+// Similar to the previous cases, but the broken config would modify the
+// running config of one of the classes.
+TEST_F(DatasrcConfigTest, brokenConfigForModify) {
initializeINList();
// Put the CH there
const ElementPtr
config1(Element::fromJSON("{\"IN\": [{\"type\": \"yyy\"}], "
"\"CH\": [{\"type\": \"xxx\"}]}"));
testConfigureDataSource(*this, config1);
- // Now, the CH happens first. But nevertheless, it should be
- // restored to the previoeus version.
+ // Now, the CH change will be handled first without an error, then
+ // the change to the IN class will fail, and the none of the changes
+ // will apply.
const ElementPtr
config2(Element::fromJSON("{\"IN\": [{\"type\": 13}], "
"\"CH\": [{\"type\": \"yyy\"}]}"));
More information about the bind10-changes
mailing list