Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-224

Restrictions on use of signal.signal() to register signal handlers.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3.1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              grahamd Graham Phillip Dumpleton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: