BIND 10 trac2922, updated. 61a6cfae29c657daedd334fc2a157d57e85948a3 [2292] Unrelated: fix possible in None bug (not reproduced)
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jun 3 12:06:39 UTC 2013
The branch, trac2922 has been updated
via 61a6cfae29c657daedd334fc2a157d57e85948a3 (commit)
via c188affb416fc02d45a0932fec1e788303425d88 (commit)
via 64dec90474339bab08323f8b76cde47ddd2d8f73 (commit)
from 4bed4a498354aab3faf234bc76b3f0fbc5a94fe3 (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 61a6cfae29c657daedd334fc2a157d57e85948a3
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Mon Jun 3 14:05:13 2013 +0200
[2292] Unrelated: fix possible in None bug (not reproduced)
In case the EINTR would happen, the reads variable would contain None,
making the in operator fail.
commit c188affb416fc02d45a0932fec1e788303425d88
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Mon Jun 3 14:02:12 2013 +0200
[2292] Unrelated: remove unused import
commit 64dec90474339bab08323f8b76cde47ddd2d8f73
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Mon Jun 3 14:01:30 2013 +0200
[2292] Send the notifications
Also, make sure we don't block long time on a function holding a mutex.
We use select for that.
-----------------------------------------------------------------------
Summary of changes:
src/bin/cmdctl/cmdctl.py.in | 1 -
src/bin/msgq/msgq.py.in | 19 +++++++++++++++++--
src/bin/zonemgr/zonemgr.py.in | 1 +
3 files changed, 18 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/cmdctl/cmdctl.py.in b/src/bin/cmdctl/cmdctl.py.in
index b1ee903..7a9e8b8 100755
--- a/src/bin/cmdctl/cmdctl.py.in
+++ b/src/bin/cmdctl/cmdctl.py.in
@@ -36,7 +36,6 @@ import re
import ssl, socket
import isc
import pprint
-import select
import csv
import random
import time
diff --git a/src/bin/msgq/msgq.py.in b/src/bin/msgq/msgq.py.in
index cba8546..1685a5e 100755
--- a/src/bin/msgq/msgq.py.in
+++ b/src/bin/msgq/msgq.py.in
@@ -199,6 +199,7 @@ class MsgQ:
# not for performance, so we use wide lock scopes to be on the safe
# side.
self.__lock = threading.Lock()
+ self._session = None
def members_notify(self, event, params):
"""
@@ -220,7 +221,11 @@ class MsgQ:
notifications gets a notification about itself, but not in the case
of unsubscribing).
"""
- # Empty for now.
+ # Due to the interaction between threads (and fear it might influence
+ # sending stuff), we test this method in msgq_run_test, instead of
+ # mocking the ccs.
+ if self._session: # Don't send before we have started up
+ self._session.notify('cc_members', event, params)
def cfgmgr_ready(self, ready=True):
"""Notify that the config manager is either subscribed, or
@@ -924,13 +929,23 @@ if __name__ == "__main__":
msgq.command_handler,
None, True,
msgq.socket_file)
+ msgq._session = session
session.start()
# And we create a thread that'll just wait for commands and
# handle them. We don't terminate the thread, we set it to
# daemon. Once the main thread terminates, it'll just die.
def run_session():
while True:
- session.check_command(False)
+ # As the check_command has internal mutex that is shared
+ # with sending part (which includes notify). So we don't
+ # want to hold it long-term and block using select.
+ fileno = session.get_socket().fileno()
+ try:
+ (reads, _, _) = select.select([fileno], [], [])
+ except select.error as se:
+ if se.args[0] != errno.EINTR:
+ raise
+ session.check_command(True)
background_thread = threading.Thread(target=run_session)
background_thread.daemon = True
background_thread.start()
diff --git a/src/bin/zonemgr/zonemgr.py.in b/src/bin/zonemgr/zonemgr.py.in
index fcb929a..71c7aae 100755
--- a/src/bin/zonemgr/zonemgr.py.in
+++ b/src/bin/zonemgr/zonemgr.py.in
@@ -691,6 +691,7 @@ class Zonemgr:
try:
while not self._shutdown_event.is_set():
fileno = self._module_cc.get_socket().fileno()
+ reads = []
# Wait with select() until there is something to read,
# and then read it using a non-blocking read
# This may or may not be relevant data for this loop,
More information about the bind10-changes
mailing list