[svn] commit: r2917 - /branches/trac312/src/bin/cmdctl/cmdctl.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Sep 14 14:31:09 UTC 2010


Author: jelte
Date: Tue Sep 14 14:31:09 2010
New Revision: 2917

Log:
found an uncaught timeout possibility

Modified:
    branches/trac312/src/bin/cmdctl/cmdctl.py.in

Modified: branches/trac312/src/bin/cmdctl/cmdctl.py.in
==============================================================================
--- branches/trac312/src/bin/cmdctl/cmdctl.py.in (original)
+++ branches/trac312/src/bin/cmdctl/cmdctl.py.in Tue Sep 14 14:31:09 2010
@@ -380,6 +380,7 @@
     def send_command(self, module_name, command_name, params = None):
         '''Send the command from bindctl to proper module. '''
         errstr = 'unknown error'
+        answer = None
         if self._verbose:
             self.log_info("Begin send command '%s' to module '%s'" %(command_name, module_name))
 
@@ -390,7 +391,10 @@
             msg = ccsession.create_command(command_name, params)
             seq = self._cc.group_sendmsg(msg, module_name)
             #TODO, it may be blocked, msqg need to add a new interface waiting in timeout.
-            answer, env = self._cc.group_recvmsg(False, seq)
+            try:
+                answer, env = self._cc.group_recvmsg(False, seq)
+            except isc.cc.session.SessionTimeout:
+                errstr = "Module '%s' not responding" % module_name
 
         if self._verbose:
             self.log_info("Finish send command '%s' to module '%s'" % (command_name, module_name))
@@ -410,7 +414,6 @@
             except ccsession.ModuleCCSessionError as mcse:
                 errstr = str("Error in ccsession answer:") + str(mcse)
                 self.log_info(errstr)
-        
         return 1, {'error': errstr}
     
     def log_info(self, msg):




More information about the bind10-changes mailing list