Browse Source

Merge branch 'master' of git+ssh://git.bind10.isc.org/var/bind10/git/bind10

Michal 'vorner' Vaner 12 years ago
parent
commit
3758398448
1 changed files with 13 additions and 1 deletions
  1. 13 1
      src/bin/zonemgr/zonemgr.py.in

+ 13 - 1
src/bin/zonemgr/zonemgr.py.in

@@ -690,7 +690,19 @@ class Zonemgr:
         self.running = True
         self.running = True
         try:
         try:
             while not self._shutdown_event.is_set():
             while not self._shutdown_event.is_set():
-                self._module_cc.check_command(False)
+                fileno = self._module_cc.get_socket().fileno()
+                # Wait with select() until there is something to read,
+                # and then read it using a non-blocking read
+                # This may or may not be relevant data for this loop,
+                # but due to the way the zonemgr does threading, we
+                # can't have a blocking read loop here.
+                try:
+                    (reads, _, _) = select.select([fileno], [], [])
+                except select.error as se:
+                    if se.args[0] != errno.EINTR:
+                        raise
+                if fileno in reads:
+                    self._module_cc.check_command(True)
         finally:
         finally:
             self._module_cc.send_stopping()
             self._module_cc.send_stopping()