BIND 10 master, updated. 6c611b5c04a5484df7269a603be4f00c4f7fa7f2 [master] update new entry

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Apr 5 10:38:41 UTC 2011


The branch, master has been updated
       via  6c611b5c04a5484df7269a603be4f00c4f7fa7f2 (commit)
       via  0355bddc92f6df66ef50b920edd6ec3b27920d61 (commit)
       via  dec73bbd6dedb0068efe90ee8d77c020778b38db (commit)
       via  e1e592789ebc8806b9a8767af95c41c1ec2d5a14 (commit)
       via  4f42307f123f7ed147b537430e0f2e9a1c665e8e (commit)
       via  afa5624c2c3503df1f152f82278f1b9dba19b533 (commit)
       via  d6c0273c617498a8bee3a813e013837e7c16b7e6 (commit)
       via  99fdcbeaa5ea2a5432fc47f39c5ed40f4850b843 (commit)
       via  a263e7d8bc90224bb6acf8b096d6ce8c87c8647a (commit)
      from  62a61edffac3ebdd91fec693fe2c1a94785ddb25 (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 6c611b5c04a5484df7269a603be4f00c4f7fa7f2
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Apr 5 19:38:02 2011 +0900

    [master] update new entry

commit 0355bddc92f6df66ef50b920edd6ec3b27920d61
Merge: 62a61edffac3ebdd91fec693fe2c1a94785ddb25 dec73bbd6dedb0068efe90ee8d77c020778b38db
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Tue Apr 5 19:35:46 2011 +0900

    Merge branch 'trac698'
    
    Conflicts:
    	ChangeLog

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

Summary of changes:
 ChangeLog                                          |    5 +++++
 src/lib/python/isc/config/ccsession.py             |    3 +++
 src/lib/python/isc/config/tests/ccsession_test.py  |   13 ++++++++++++-
 .../isc/config/tests/unittest_fakesession.py       |    9 ++++++++-
 4 files changed, 28 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 0c92bb8..b426fb2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+  212.  [bug]		naokikambe
+	Fixed that the ModuleCCSession object may group_unsubscribe in the
+	closed CC session in being deleted.
+	(Trac #698, git 0355bddc92f6df66ef50b920edd6ec3b27920d61)
+
   211.  [func]		shane
 	Implement "--brittle" option, which causes the server to exit
         if any of BIND 10's processes dies.
diff --git a/src/lib/python/isc/config/ccsession.py b/src/lib/python/isc/config/ccsession.py
index 942bf79..226c6ba 100644
--- a/src/lib/python/isc/config/ccsession.py
+++ b/src/lib/python/isc/config/ccsession.py
@@ -151,6 +151,9 @@ class ModuleCCSession(ConfigData):
         self._remote_module_configs = {}
 
     def __del__(self):
+        # If the CC Session obejct has been closed, it returns
+        # immediately.
+        if self._session._closed: return
         self._session.group_unsubscribe(self._module_name, "*")
         for module_name in self._remote_module_configs:
             self._session.group_unsubscribe(module_name)
diff --git a/src/lib/python/isc/config/tests/ccsession_test.py b/src/lib/python/isc/config/tests/ccsession_test.py
index 2ae37f5..4edc559 100644
--- a/src/lib/python/isc/config/tests/ccsession_test.py
+++ b/src/lib/python/isc/config/tests/ccsession_test.py
@@ -234,7 +234,18 @@ class TestModuleCCSession(unittest.TestCase):
         fake_session = FakeModuleCCSession()
         mccs = self.create_session("spec1.spec", None, None, fake_session)
         mccs.close()
-        self.assertEqual("closed", fake_session._socket)
+        self.assertEqual(None, fake_session._socket)
+
+    def test_del_opened(self):
+        fake_session = FakeModuleCCSession()
+        mccs = self.create_session("spec1.spec", None, None, fake_session)
+        mccs.__del__() # with opened fake_session
+
+    def test_del_closed(self):
+        fake_session = FakeModuleCCSession()
+        mccs = self.create_session("spec1.spec", None, None, fake_session)
+        fake_session.close()
+        mccs.__del__() # with closed fake_session
 
     def my_config_handler_ok(self, new_config):
         return isc.config.ccsession.create_answer(0)
diff --git a/src/lib/python/isc/config/tests/unittest_fakesession.py b/src/lib/python/isc/config/tests/unittest_fakesession.py
index e31b436..1641ec0 100644
--- a/src/lib/python/isc/config/tests/unittest_fakesession.py
+++ b/src/lib/python/isc/config/tests/unittest_fakesession.py
@@ -35,6 +35,7 @@ class FakeModuleCCSession:
         # the message_queue is empty when receive is called, throw
         # a SessionTimeout
         self._timeout = 0
+        self._closed = False
 
     def group_subscribe(self, group_name, instance_name = None):
         if not group_name in self.subscriptions:
@@ -43,6 +44,11 @@ class FakeModuleCCSession:
             self.subscriptions[group_name].append(instance_name)
             
     def group_unsubscribe(self, group_name, instance_name = None):
+
+        # raises SessionError if the session has been already closed.
+        if self._closed:
+            raise isc.cc.SessionError("Session has been closed.")        
+
         if group_name in self.subscriptions:
             if instance_name:
                 if len(self.subscriptions[group_name]) > 1:
@@ -94,7 +100,8 @@ class FakeModuleCCSession:
 
     def close(self):
         # need to pass along somehow that this function has been called,
-        self._socket = "closed"
+        self._socket = None
+        self._closed = True
 
     def set_timeout(self, timeout):
         self._timeout = timeout




More information about the bind10-changes mailing list