BIND 10 trac1288, updated. 8c07f46adfdd748ee33b3b5e9d33a78a64dded10 [1288] added some comment about data source client creation.

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Nov 11 19:00:34 UTC 2011


The branch, trac1288 has been updated
       via  8c07f46adfdd748ee33b3b5e9d33a78a64dded10 (commit)
       via  235ff5af7733a7d464b172c4424f8facf284fed6 (commit)
       via  8f3f3e9da36c5a0cbbfa4e2a5ddc598be7fece4a (commit)
       via  fe04c9377836fcd387f79447906e7ec83911b5b2 (commit)
      from  0f76bcddad8050baf811b0eaa5a117cc61dcbba1 (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 8c07f46adfdd748ee33b3b5e9d33a78a64dded10
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Nov 11 10:59:01 2011 -0800

    [1288] added some comment about data source client creation.

commit 235ff5af7733a7d464b172c4424f8facf284fed6
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Nov 11 10:51:20 2011 -0800

    [1288] cover the successful case for _check_xfrout_available in tests.

commit 8f3f3e9da36c5a0cbbfa4e2a5ddc598be7fece4a
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Nov 11 10:49:09 2011 -0800

    [1288] typo

commit fe04c9377836fcd387f79447906e7ec83911b5b2
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Nov 11 10:46:50 2011 -0800

    [1288] cleanups for MockDataSrcClient.get_soa:
    - use the initialized zone name for the owner instead of the hardcoded one
    - removed a redundant return
    for now these don't affect the test results, but it's cleaner and may
    have a substantial difference in future extensions.

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

Summary of changes:
 src/bin/xfrout/tests/xfrout_test.py.in  |    9 +++++----
 src/lib/python/isc/notify/notify_out.py |    5 +++++
 2 files changed, 10 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/xfrout/tests/xfrout_test.py.in b/src/bin/xfrout/tests/xfrout_test.py.in
index 4043cb7..7202742 100644
--- a/src/bin/xfrout/tests/xfrout_test.py.in
+++ b/src/bin/xfrout/tests/xfrout_test.py.in
@@ -77,8 +77,8 @@ class MockDataSrcClient:
     def get_soa(self):  # emulate ZoneIterator.get_soa()
         if self._zone_name == Name('nosoa.example.com'):
             return None
-        soa_rrset = RRset(Name('multisoa.example.com'), RRClass.IN(),
-                          RRType.SOA(), RRTTL(3600))
+        soa_rrset = RRset(self._zone_name, RRClass.IN(), RRType.SOA(),
+                          RRTTL(3600))
         soa_rrset.add_rdata(Rdata(RRType.SOA(), RRClass.IN(),
                                   'master.example.com. ' +
                                   'admin.example.com. 1234 ' +
@@ -88,7 +88,6 @@ class MockDataSrcClient:
                                       'master.example.com. ' +
                                       'admin.example.com. 1300 ' +
                                       '3600 1800 2419200 7200'))
-            return soa_rrset
         return soa_rrset
 
 class MyCCSession(isc.config.ConfigData):
@@ -220,7 +219,7 @@ class TestXfroutSession(unittest.TestCase):
     def test_exception_from_session(self):
         '''Test the case where the main processing raises an exception.
 
-        We just check it doesn't any unexpected disruption and (in teraDown)
+        We just check it doesn't any unexpected disruption and (in tearDown)
         transfer_counter is correctly reset to 0.
 
         '''
@@ -619,6 +618,8 @@ class TestXfroutSession(unittest.TestCase):
     def test_check_xfrout_available(self):
         self.xfrsess.ClientClass = MockDataSrcClient
         self.assertEqual(self.xfrsess._check_xfrout_available(
+                Name('example.com')), Rcode.NOERROR())
+        self.assertEqual(self.xfrsess._check_xfrout_available(
                 Name('notauth.example.com')), Rcode.NOTAUTH())
         self.assertEqual(self.xfrsess._check_xfrout_available(
                 Name('nosoa.example.com')), Rcode.SERVFAIL())
diff --git a/src/lib/python/isc/notify/notify_out.py b/src/lib/python/isc/notify/notify_out.py
index 67d3d56..af79b7c 100644
--- a/src/lib/python/isc/notify/notify_out.py
+++ b/src/lib/python/isc/notify/notify_out.py
@@ -491,6 +491,11 @@ class NotifyOut:
         return msg, qid
 
     def _get_zone_soa(self, zone_name, zone_class):
+        # We create (and soon drop) the data source client here because
+        # clients should be thread specific.  We could let the main thread
+        # loop (_dispatcher) create and retain the client in order to avoid
+        # the overhead when we generalize the interface (and we may also
+        # revisit the design of notify_out more substantially anyway).
         datasrc_config = '{ "database_file": "' + self._db_file + '"}'
         result, finder = DataSourceClient('sqlite3',
                                           datasrc_config).find_zone(zone_name)




More information about the bind10-changes mailing list