BIND 10 trac502-fix-author, updated. c30cd00cf1afde68776d7320cb283a8f9a911163 Merge branch 'master' into trac502-fix-author

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Jan 26 03:22:26 UTC 2011


The branch, trac502-fix-author has been updated
       via  c30cd00cf1afde68776d7320cb283a8f9a911163 (commit)
       via  6f6f5892046cb552bf334d2e5f84cf575dde3da5 (commit)
       via  a2a812ede6d3df4a70d6309437c6715cb09a7670 (commit)
       via  acc6a3ab370cd5c22ad37bb79f819578bb1e6e97 (commit)
       via  3e5f772632f1472a1125e0cd725adf6709635e8c (commit)
       via  a07e078b4feeb01949133fc88c9939254c38aa7c (commit)
       via  a039907d688e2ae82af39369baa72a9c43805eb1 (commit)
       via  3c337419ad37fb4af2d14e7d470e7c9c35790b40 (commit)
       via  d6d7f1157668e98a1f849d53258b8f9c1dee1c78 (commit)
       via  ce2fead07b25247d05b3175a30863a898b819db1 (commit)
      from  749c26e2c6cdc98abf0f7d6dc693acf122e5d9f5 (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 c30cd00cf1afde68776d7320cb283a8f9a911163
Merge: 749c26e2c6cdc98abf0f7d6dc693acf122e5d9f5 6f6f5892046cb552bf334d2e5f84cf575dde3da5
Author: chenzhengzhang <jerry.zzpku at gmail.com>
Date:   Wed Jan 26 09:53:59 2011 +0800

    Merge branch 'master' into trac502-fix-author

commit 6f6f5892046cb552bf334d2e5f84cf575dde3da5
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Jan 25 22:35:13 2011 +0100

    [trac420] Fix some portability issues
    
    * kqueue maybe doesn't survive fork on MacOS
    * add_kqueue_socket wanted socket, not fileno
    * Some systems don't have MSG_DONTWAIT, so we set the socket nonblocking

commit a2a812ede6d3df4a70d6309437c6715cb09a7670
Merge: 3e5f772632f1472a1125e0cd725adf6709635e8c acc6a3ab370cd5c22ad37bb79f819578bb1e6e97
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Jan 25 18:28:33 2011 +0100

    Merge branch 'bug/msgq/test'

commit acc6a3ab370cd5c22ad37bb79f819578bb1e6e97
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Jan 25 17:24:45 2011 +0100

    [trac420] Try not to timeout on slow machines
    
    Some of our built machines time out, for two possible reasons:
    * They have long buffer before they start blocking. Therefore the amount
      of data sent is increased.
    * They have clock with low precision, so if now - last_sent > 0.1:
      happens after a long time. So the timeout waiting for that was
      increased.

commit 3e5f772632f1472a1125e0cd725adf6709635e8c
Author: Jelte Jansen <jelte at isc.org>
Date:   Tue Jan 25 17:09:18 2011 +0100

    Add changelog

commit a07e078b4feeb01949133fc88c9939254c38aa7c
Merge: 748885cd80a12aad0f02fc7b53943c2620d9eb22 a039907d688e2ae82af39369baa72a9c43805eb1
Author: Jelte Jansen <jelte at isc.org>
Date:   Tue Jan 25 16:57:41 2011 +0100

    Merge branch 'trac483'
    
    Conflicts:
    	src/bin/resolver/resolver.cc

commit a039907d688e2ae82af39369baa72a9c43805eb1
Author: Jelte Jansen <jelte at isc.org>
Date:   Mon Jan 24 14:36:40 2011 +0100

    some trivial style issues
    
    mostly whitespace, one comment update and two lines of dead code

commit 3c337419ad37fb4af2d14e7d470e7c9c35790b40
Author: Scott Mann <smann at isc.org>
Date:   Sat Jan 22 12:24:15 2011 -0700

    cleaned up a few debug dlogs, removed an extraneous ; and added a comment.

commit d6d7f1157668e98a1f849d53258b8f9c1dee1c78
Author: Scott Mann <smann at isc.org>
Date:   Sat Jan 22 08:56:46 2011 -0700

    put root server ip list into recursive query object

commit ce2fead07b25247d05b3175a30863a898b819db1
Author: Scott Mann <smann at isc.org>
Date:   Thu Jan 20 15:01:13 2011 -0700

    First task of trac483
    Added support for specifying root servers in configuration.

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

Summary of changes:
 src/bin/msgq/msgq.py.in         |   12 +++++++++---
 src/bin/msgq/tests/msgq_test.py |   16 +++++++++++-----
 2 files changed, 20 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/msgq/msgq.py.in b/src/bin/msgq/msgq.py.in
index c5affbf..deaea6c 100644
--- a/src/bin/msgq/msgq.py.in
+++ b/src/bin/msgq/msgq.py.in
@@ -323,12 +323,18 @@ class MsgQ:
 
     def __send_data(self, sock, data):
         try:
-            return sock.send(data, socket.MSG_DONTWAIT)
+            # We set the socket nonblocking, MSG_DONTWAIT doesn't exist
+            # on some OSes
+            sock.setblocking(0)
+            return sock.send(data)
         except socket.error as e:
             if e.errno == errno.EAGAIN or e.errno == errno.EWOULDBLOCK:
                 return 0
             else:
                 raise e
+        finally:
+            # And set it back again
+            sock.setblocking(1)
 
     def send_prepared_msg(self, sock, msg):
         # Try to send the data, but only if there's nothing waiting
@@ -355,7 +361,7 @@ class MsgQ:
                     self.poller.register(fileno, select.POLLIN |
                         select.POLLOUT)
                 else:
-                    self.add_kqueue_socket(fileno, True)
+                    self.add_kqueue_socket(sock, True)
             self.sendbuffs[fileno] = (last_sent, buff)
 
     def __process_write(self, fileno):
@@ -370,7 +376,7 @@ class MsgQ:
             if self.poller:
                 self.poller.register(fileno, select.POLLIN)
             else:
-                self.add_kqueue_socket(fileno)
+                self.add_kqueue_socket(sock)
             del self.sendbuffs[fileno]
         else:
             self.sendbuffs[fileno] = (time.clock(), msg)
diff --git a/src/bin/msgq/tests/msgq_test.py b/src/bin/msgq/tests/msgq_test.py
index a0a4b1b..efae151 100644
--- a/src/bin/msgq/tests/msgq_test.py
+++ b/src/bin/msgq/tests/msgq_test.py
@@ -117,7 +117,7 @@ class SendNonblock(unittest.TestCase):
     Tests that the whole thing will not get blocked if someone does not read.
     """
 
-    def terminate_check(self, task, timeout = 1):
+    def terminate_check(self, task, timeout = 10):
         """
         Runs task in separate process (task is a function) and checks
         it terminates sooner than timeout.
@@ -161,23 +161,28 @@ class SendNonblock(unittest.TestCase):
         Tries sending messages (and not reading them) until it either times
         out (in blocking call, wrong) or closes it (correct).
         """
+        data = "data"
+        for i in range(1, 10):
+            data += data
         self.terminate_check(lambda: self.infinite_sender(
-            lambda msgq, socket: msgq.sendmsg(socket, {}, {"message" : "x"})))
+            lambda msgq, socket: msgq.sendmsg(socket, {}, {"message" : data})))
 
     def test_infinite_sendprepared(self):
         """
         Tries sending data (and not reading them) until it either times
         out (in blocking call, wrong) or closes it (correct).
         """
+        data = b"data"
+        for i in range(1, 10):
+            data += data
         self.terminate_check(lambda: self.infinite_sender(
-            lambda msgq, socket: msgq.send_prepared_msg(socket, b"data")))
+            lambda msgq, socket: msgq.send_prepared_msg(socket, data)))
 
     def send_many(self, data):
         """
         Tries that sending a command many times and getting an answer works.
         """
         msgq = MsgQ()
-        msgq.setup_poller()
         # msgq.run needs to compare with the listen_socket, so we provide
         # a replacement
         class DummySocket:
@@ -189,7 +194,8 @@ class SendNonblock(unittest.TestCase):
             length = len(data)
             queue_pid = os.fork()
             if queue_pid == 0:
-                signal.alarm(10)
+                signal.alarm(30)
+                msgq.setup_poller()
                 msgq.register_socket(queue)
                 msgq.run()
             else:




More information about the bind10-changes mailing list