[ZODB-Dev] ZEO signal handling cleanup

Guido van Rossum guido@python.org
Thu, 10 Oct 2002 15:16:48 -0400


I'm trying to clean up signal handling in the ZEO storage server.

Here's the current situation:

  SIGTERM - terminate cleanly
  SIGINT  - restart cleanly
  SIGHUP  - close and reopen the log file

I propose that in the final ZEO 2 release it will be like this:

  SIGTERM - terminate cleanly (unchanged)
  SIGHUP  - restart cleanly
  SIGUSR1 - close and reopen the log file

This makes more sense, and the first two match the signal actions for
Zope.  Reopening the log file seems a non-standard thing to do with a
signal so SIGUSR1 (or SIGUSR2) would seem appropriate.  (Zope used to
interpret SIGUSR2 as a request to pack the database, though ChrisM has
removed this now from the trunk and I believe also from the Zope 2.6
branch.)

I'm also trying to clean up what's written to the var/ZEO_SERVER.pid
file.  Currently this contains two pids: the pid of the zdaemon
process, and the pid of its child, the actual storage server process.
if you do e.g. kill -HUP `cat var/ZEO_SERVER.pid` you send the signal
to both processes; but the zdaemon process forwards signals to its child
so the child will get two signals.  I propose to only write the pid of
the zdaemond process.

If anybody has a problem with this, please let me know -- if I don't
get any objections, I'll make it so in the final ZODB 3.1 release (in
a few weeks probably).

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