Browse Source

Fix busyloop in b10-stats

Use blocking reads of the CCsession. Updated test to include the
optional parameter too.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac382@3283 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner 14 years ago
parent
commit
e4801e8453
2 changed files with 3 additions and 3 deletions
  1. 1 1
      src/bin/stats/stats.py.in
  2. 2 2
      src/bin/stats/tests/isc/config/ccsession.py

+ 1 - 1
src/bin/stats/stats.py.in

@@ -233,7 +233,7 @@ class CCSessionListener(Listener):
         """
         check the cc chanel
         """
-        return self.cc_session.check_command()
+        return self.cc_session.check_command(False)
 
     def config_handler(self, new_config):
         """

+ 2 - 2
src/bin/stats/tests/isc/config/ccsession.py

@@ -90,8 +90,8 @@ class ModuleCCSession(ConfigData):
     def close(self):
         self._session.close()
 
-    def check_command(self):
-        msg, env = self._session.group_recvmsg(False)
+    def check_command(self, nonblock=True):
+        msg, env = self._session.group_recvmsg(nonblock)
         if not msg or 'result' in msg:
             return
         cmd, arg = parse_command(msg)