[Zope-Coders] Daemon signal passing race condition

Guido van Rossum guido@python.org
Fri, 11 Oct 2002 08:39:26 -0400


> It still looks like there is a problem with the daemon process forwarding 
> signals. There is a small window in between forking a new child process and 
> registering a new signal handler.... If the daemon process receives SIGTERM 
> inside this window then it will forward SIGTERM to the recently deceased 
> child pid (not the newly forked one), then exit itself. This leaves an 
> orphaned child process.
> 
> I think the right solution is to mask the interesting signals during the 
> refork. Unfortunately sigprocmask and friends are not exposed by the python 
> standard library.

They will be in Python 2.3...

--Guido van Rossum (home page: http://www.python.org/~guido/)