Parcourir la source

a well-timed ctrl-c may stop msgq before bind10, in which case 0-bytes are read, which is now an error. Catch that error and break from the for loop, so bob will go into shutdown mode cleanly

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac312@2936 e5f2f494-b856-4b98-b285-d166d9295462
Jelte Jansen il y a 14 ans
Parent
commit
fdba520a89
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      src/bin/bind10/bind10.py.in

+ 6 - 1
src/bin/bind10/bind10.py.in

@@ -735,7 +735,12 @@ def main():
 
 
         for fd in rlist + xlist:
         for fd in rlist + xlist:
             if fd == ccs_fd:
             if fd == ccs_fd:
-                boss_of_bind.ccs.check_command()
+                try:
+                    boss_of_bind.ccs.check_command()
+                except isc.cc.session.ProtocolError:
+                    if options.verbose:
+                        sys.stderr.write("[bind10] msgq channel disappeared.\n")
+                    break
             elif fd == wakeup_fd:
             elif fd == wakeup_fd:
                 os.read(wakeup_fd, 32)
                 os.read(wakeup_fd, 32)