[svn] commit: r438 - in /branches/parkinglot/src/bin/bind10: TODO bind10.py
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jan 8 12:55:21 UTC 2010
Author: shane
Date: Fri Jan 8 12:55:21 2010
New Revision: 438
Log:
Moved child process cleanup out of signal handler.
Fix for broken msgq startup.
Update TODO.
Modified:
branches/parkinglot/src/bin/bind10/TODO
branches/parkinglot/src/bin/bind10/bind10.py
Modified: branches/parkinglot/src/bin/bind10/TODO
==============================================================================
--- branches/parkinglot/src/bin/bind10/TODO (original)
+++ branches/parkinglot/src/bin/bind10/TODO Fri Jan 8 12:55:21 2010
@@ -1,4 +1,3 @@
-- Move child cleanup & restart out of signal handler
- Read msgq configuration from configuration manager
- Provide more administrator options:
- Get process list
@@ -12,3 +11,4 @@
- Back-off mechanism for restarting failed processes
- Start statistics daemon
- Statistics interaction (?)
+- Stop using poll(), as primitive operating systems (OS X) don't support it
Modified: branches/parkinglot/src/bin/bind10/bind10.py
==============================================================================
--- branches/parkinglot/src/bin/bind10/bind10.py (original)
+++ branches/parkinglot/src/bin/bind10/bind10.py Fri Jan 8 12:55:21 2010
@@ -112,7 +112,7 @@
while self.cc_session is None:
# if we have been trying for "a while" give up
if (time.time() - cc_connect_start) > 5:
- c_channel.kill()
+ c_channel.process.kill()
return "Unable to connect to c-channel after 5 seconds"
# try to connect, and if we can't wait a short while
try:
@@ -279,16 +279,10 @@
if __name__ == "__main__":
def reaper(signal_number, stack_frame):
"""A child process has died (SIGCHLD received)."""
- global boss_of_bind
- while True:
- try:
- (pid, exit_status) = os.waitpid(-1, os.WNOHANG)
- except OSError as o:
- if o.errno == errno.ECHILD: break
- raise
- if pid == 0: break
- if boss_of_bind:
- boss_of_bind.reap(pid, exit_status)
+ # don't do anything...
+ # the Python signal handler has been set up to write
+ # down a pipe, waking up our select() bit
+ pass
def get_signame(signal_number):
"""Return the symbolic name for a signal."""
@@ -377,6 +371,17 @@
elif fd == wakeup_fd:
os.read(wakeup_fd, 32)
+ # clean up any processes that exited
+ while True:
+ try:
+ (pid, exit_status) = os.waitpid(-1, os.WNOHANG)
+ except OSError as o:
+ if o.errno == errno.ECHILD: break
+ # XXX: should be impossible to get any other error here
+ raise
+ if pid == 0: break
+ boss_of_bind.reap(pid, exit_status)
+
boss_of_bind.restart_processes()
# shutdown
More information about the bind10-changes
mailing list