BIND 10 master, updated. ccb253d801db7496dfc6a93a90db4a23cf2300ae Merge branch 'master' of ssh://git.bind10.isc.org/var/bind10/git/bind10
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Oct 29 05:58:24 UTC 2013
The branch, master has been updated
via ccb253d801db7496dfc6a93a90db4a23cf2300ae (commit)
via f8fac8823dd928e2b5d6f4bf7bb31ca992dc0562 (commit)
via c18a49b0435c656669e6f87ef65d44dc98e0e726 (commit)
via 83950286387c7e41661c810dc173171e8b9e1fd9 (commit)
via d67f893b43f1c293d7342dbd02a6cbf044d3a201 (commit)
via 6ff2610c28228d3a91b428b178517ff2bb7fbe69 (commit)
via 9cb427b4940ed7531facf3420f3bdd94afc37f64 (commit)
from 75867fdfdc6e53045e934d597bc601fca2caf204 (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 ccb253d801db7496dfc6a93a90db4a23cf2300ae
Merge: f8fac88 75867fd
Author: Kean Johnston <kean at isc.org>
Date: Tue Oct 29 07:57:22 2013 +0200
Merge branch 'master' of ssh://git.bind10.isc.org/var/bind10/git/bind10
Conflicts:
ChangeLog
commit f8fac8823dd928e2b5d6f4bf7bb31ca992dc0562
Author: Kean Johnston <kean at isc.org>
Date: Tue Oct 29 07:54:53 2013 +0200
[master] Updated ChangeLog
commit c18a49b0435c656669e6f87ef65d44dc98e0e726
Merge: 64ae993 8395028
Author: Kean Johnston <kean at isc.org>
Date: Tue Oct 29 07:49:01 2013 +0200
[433] Merge branch 'trac433'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
src/bin/msgq/msgq.py.in | 21 +++++++++++++++++++--
src/bin/msgq/msgq_messages.mes | 4 ++++
src/bin/msgq/tests/msgq_run_test.py | 16 ++++++++++++++++
4 files changed, 45 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index f0724eb..17e9a4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+703. [bug] kean
+ A bug in b10-msgq was fixed where it would remove the socket file if
+ there was an existing copy of b10-msgq running. It now correctly
+ detects and reports this without removing the socket file.
+ (Trac #433, git c18a49b0435c656669e6f87ef65d44dc98e0e726)
+
702. [func] marcin
perfdhcp: support for sending DHCPv6 Renew messages at the specified
rate and measure performance.
diff --git a/src/bin/msgq/msgq.py.in b/src/bin/msgq/msgq.py.in
index 07ea5ba..450ee20 100755
--- a/src/bin/msgq/msgq.py.in
+++ b/src/bin/msgq/msgq.py.in
@@ -74,6 +74,8 @@ SPECFILE_LOCATION = SPECFILE_PATH + "/msgq.spec"
class MsgQReceiveError(Exception): pass
+class MsgQRunningError(Exception): pass
+
class MsgQCloseOnReceive(Exception):
"""Exception raised when reading data from a socket results in 'shutdown'.
@@ -268,11 +270,26 @@ class MsgQ:
"""Set up the listener socket. Internal function."""
logger.debug(TRACE_BASIC, MSGQ_LISTENER_SETUP, self.socket_file)
- self.listen_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-
if os.path.exists(self.socket_file):
+ # Rather than just blindly removing the socket file, attempt to
+ # connect to the existing socket to see if there is an existing
+ # msgq running. Only if that fails do we remove the file and
+ # attempt to create a new socket.
+ existing_msgq = None
+ try:
+ existing_msgq = isc.cc.Session(self.socket_file)
+ except isc.cc.session.SessionError:
+ existing_msgq = None
+
+ if existing_msgq:
+ existing_msgq.close()
+ logger.fatal(MSGQ_ALREADY_RUNNING)
+ raise MsgQRunningError("b10-msgq already running")
+
os.remove(self.socket_file)
+
try:
+ self.listen_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.listen_socket.bind(self.socket_file)
self.listen_socket.listen(1024)
except Exception as e:
diff --git a/src/bin/msgq/msgq_messages.mes b/src/bin/msgq/msgq_messages.mes
index 2bd2515..3f6e6bc 100644
--- a/src/bin/msgq/msgq_messages.mes
+++ b/src/bin/msgq/msgq_messages.mes
@@ -19,6 +19,10 @@
# <topsrcdir>/tools/reorder_message_file.py to make sure the
# messages are in the correct order.
+% MSGQ_ALREADY_RUNNING Another copy of b10-msgq is already running.
+Only a single instance of b10-msgq should ever be run at one time.
+This instance will now terminate.
+
% MSGQ_CFGMGR_SUBSCRIBED The config manager subscribed to message queue
This is a debug message. The message queue has little bit of special handling
for the configuration manager. This special handling is happening now.
diff --git a/src/bin/msgq/tests/msgq_run_test.py b/src/bin/msgq/tests/msgq_run_test.py
index 9cf6da6..5b0c711 100644
--- a/src/bin/msgq/tests/msgq_run_test.py
+++ b/src/bin/msgq/tests/msgq_run_test.py
@@ -328,6 +328,22 @@ class MsgqRunTest(unittest.TestCase):
'group': 'notifications/cc_members'
}]}, msg)
+ def test_multiple_invocations(self):
+ """
+ Check to make sure that an attempt to start a second copy of the MsgQ
+ daemon fails.
+ """
+
+ self.assertTrue (os.path.exists(SOCKET_PATH))
+ self.__retcode = subprocess.call([MSGQ_PATH, '-s', SOCKET_PATH])
+ self.assertNotEqual(self.__retcode, 0)
+
+ # Verify that the socket still exists and works. We re-call
+ # test_send_direct as a means of testing that the existing
+ # daemon is still behaving correctly.
+ self.assertTrue (os.path.exists(SOCKET_PATH))
+ self.test_send_direct()
+
if __name__ == '__main__':
isc.log.init("msgq-tests")
isc.log.resetUnitTestRootLogger()
More information about the bind10-changes
mailing list