BIND 10 trac775, updated. 44f4b82933783502be198c0ab0a81020fb3fe510 trac[775] fix the bug that if new configure failed, we need notify configure manager

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Apr 15 07:30:16 UTC 2011


The branch, trac775 has been updated
       via  44f4b82933783502be198c0ab0a81020fb3fe510 (commit)
      from  660d7d782c81bc55b8cc009836c35d9ca3948063 (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 44f4b82933783502be198c0ab0a81020fb3fe510
Author: hanfeng <ben.han.cn at gmail.com>
Date:   Fri Apr 15 15:15:32 2011 +0800

    trac[775] fix the bug that if new configure failed, we need notify configure manager

-----------------------------------------------------------------------

Summary of changes:
 src/bin/auth/main.cc                               |   10 ++++++++--
 src/lib/server_common/portconfig.cc                |    3 +++
 src/lib/server_common/tests/portconfig_unittest.cc |    2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/auth/main.cc b/src/bin/auth/main.cc
index 64a8325..e54ec0e 100644
--- a/src/bin/auth/main.cc
+++ b/src/bin/auth/main.cc
@@ -172,9 +172,15 @@ main(int argc, char* argv[]) {
         // all initial configurations, but as a short term workaround we
         // handle the traditional "database_file" setup by directly calling
         // updateConfig().
+        // if server load configure failed, we won't exit, give user second chance
+        // to correct the configure.
         auth_server->setConfigSession(config_session);
-        configureAuthServer(*auth_server, config_session->getFullConfig());
-        auth_server->updateConfig(ElementPtr());
+        try {
+            configureAuthServer(*auth_server, config_session->getFullConfig());
+            auth_server->updateConfig(ElementPtr());
+        } catch (const isc::Exception& ex) {
+            cout << "[bin10-auth] Server load config failed:" << ex.what() << endl;
+        }
 
         if (uid != NULL) {
             changeUser(uid);
diff --git a/src/lib/server_common/portconfig.cc b/src/lib/server_common/portconfig.cc
index 3fc81e3..1251ba1 100644
--- a/src/lib/server_common/portconfig.cc
+++ b/src/lib/server_common/portconfig.cc
@@ -115,6 +115,9 @@ installListenAddresses(const AddressList& newAddresses,
             dlog("Unable to recover from error;", true);
             dlog(string("Rollback failed with: ") + e2.what(), true);
         }
+        //Anyway the new configure has problem, we need to notify configure
+        //manager the new configure doesn't work
+        throw;
     }
 }
 
diff --git a/src/lib/server_common/tests/portconfig_unittest.cc b/src/lib/server_common/tests/portconfig_unittest.cc
index a74ad3c..5694503 100644
--- a/src/lib/server_common/tests/portconfig_unittest.cc
+++ b/src/lib/server_common/tests/portconfig_unittest.cc
@@ -175,7 +175,7 @@ TEST_F(InstallListenAddresses, rollback) {
     EXPECT_NO_THROW(installListenAddresses(valid_, store_, dnss_));
     checkAddresses(valid_, "Before rollback");
     // This should not bind them, but should leave the original addresses
-    EXPECT_NO_THROW(installListenAddresses(invalid_, store_, dnss_));
+    EXPECT_THROW(installListenAddresses(invalid_, store_, dnss_), exception);
     checkAddresses(valid_, "After rollback");
 }
 




More information about the bind10-changes mailing list