Browse Source

Fix bugs reported in ticket 125 and 126.
1. Msgq not running will be complained when start xfrout process alone.
2. Fix xfrout hang when xfrout can't get the command response from config manager.

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1662 e5f2f494-b856-4b98-b285-d166d9295462

Likun Zhang 15 years ago
parent
commit
d30412f4c6
1 changed files with 8 additions and 4 deletions
  1. 8 4
      src/bin/xfrout/xfrout.py.in

+ 8 - 4
src/bin/xfrout/xfrout.py.in

@@ -26,6 +26,7 @@ from isc.auth import sqlite3_ds
 from socketserver import *
 import os
 from isc.config.ccsession import *
+from isc.cc import SessionError
 import socket
 from optparse import OptionParser, OptionValueError
 try:
@@ -322,8 +323,8 @@ class XfroutServer:
         self._shutdown_event = threading.Event()
         self._cc = isc.config.ModuleCCSession(SPECFILE_LOCATION, self.config_handler, self.command_handler)
         self._config_data = self._cc.get_full_config()
-        self._start_xfr_query_listener()
         self._cc.start()
+        self._start_xfr_query_listener()
 
 
     def _start_xfr_query_listener(self):
@@ -412,9 +413,12 @@ if '__main__' == __name__:
         xfrout_server.run()
     except KeyboardInterrupt:
         print("[b10-xfrout] exit xfrout process")
-    except Exception as e:
-        print('[b10-xfrout] ', e)
-    
+    except SessionError as e:
+        print('[b10-xfrout] Error creating xfrout, '
+              'is the command channel daemon running?' )
+    except ModuleCCSessionError as e:
+        print('[b10-xfrout] exit xfrout process:', e)
+
     if xfrout_server:
         xfrout_server.shutdown()