Restrictions on use of signal.signal() to register signal handlers.
-------------------------------------------------------------------
Key: MODPYTHON-224
URL: https://issues.apache.org/jira/browse/MODPYTHON-224
Project: mod_python
Issue Type: New Feature
Components: core
Affects Versions: 3.3.1
Reporter: Graham Dumpleton
Apache makes use of signals as an integral part of its process management and
shutdown/restart mechanisms. At the minimum it uses the signals SIGTERM,
SIGINT, SIGHUP, SIGWINCH and SIGUSR1.
Problem is that some Python web frameworks which were originally designed to
operate using their own web server still register signal handlers even when not
being used on top of their own web server. This is the case with CherryPy and
TurboGears (which uses CherryPy).
The consequence of any Python package trying to register signal handlers for
the above signals is that they interfere with the correct operation of Apache
and can causes restarts and shutdowns to fail or not proceed correctly. Since
there generally isn't a good reason for any Python package running under
mod_python to be registering signal handlers in the first place, to protect
against such packages screwing with Apache, it may make sense for mod_python to
replace signal.signal() in any interpreters it creates such that signal handler
registrations are ignored. A warning message can be logged to indicate that
signal handler registration has been prevented. A directive could also be
implemented to allow the restriction on registering signal handlers to be
removed if still required for some reason.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.