]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1275] restore the finally statement in run function in the MockMsgq class.
authorNaoki Kambe <kambe@jprs.co.jp>
Fri, 14 Oct 2011 11:51:50 +0000 (20:51 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Fri, 14 Oct 2011 11:51:50 +0000 (20:51 +0900)
As a result of considering any other situation where self.msgq.run() in the
try statement is accidentally failed. This changes don't affect the result of
the unittest.

src/bin/stats/tests/test_utils.py

index b3f40f7bb3a81c603ebc3169a801f52766026963..5eb8f92c8cd84266fcef8090364f0817b525a6ab 100644 (file)
@@ -101,6 +101,11 @@ class MockMsgq:
             self.msgq.run()
         except Exception:
             pass
+        finally:
+            # explicitly shut down the socket of the msgq before
+            # shutting down the msgq
+            self.msgq.listen_socket.shutdown(msgq.socket.SHUT_RDWR)
+            self.msgq.shutdown()
 
     def shutdown(self):
         # do nothing