Copterfly / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Add support for Process reloading on script changes. #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When a script file is changed, it can currently trigger Module (Script), or
Interpreter reloading. When daemon processes are being used, should support
Process reloading. That is, if the script file modification time has
changed since last time application handled a request, the daemon process
should be shutdown and restarted.

Note that this is a bit tricky, as the Apache child process communicating
with the daemon process will have to wait for an acknowledgment from the
daemon process to say it will handle the request before it sends the actual
content of the request. If the daemon process indicates that it will not
handle the request and is restarting, then the Apache child process will
need to close the socket connection to the daemon process and create a new
one. If there are multiple daemon processes in the process group, the
Apache child process may have to do this as many times as there are daemon
processes in the group, until it gets a process which has finished
restarting. Some sort of upper limit of attempts would need to be
implemented. It should be more than the number of daemon processes in the
process group plus some margin.

This Process reloading mechanism is important for commodity web hosting
where sites a load balanced across a number of machines in a cluster, as
one cannot rely on an application sending itself a signal to restart, nor
on a control panel, as this can only affect the process on one machine and
not others. Thus, needs to be a way for it to automatically be detected.

Original issue reported on code.google.com by Graham.Dumpleton@gmail.com on 10 Aug 2007 at 10:03

GoogleCodeExporter commented 9 years ago

Original comment by Graham.Dumpleton@gmail.com on 17 Aug 2007 at 12:25

GoogleCodeExporter commented 9 years ago
This feature has been added to Subversion main trunk at revision 478.

If all checks out this will also be folded into 1.1 branch for inclusion in 
that version.

To use the feature, specify:

  WSGIReloadMechanism Process

in context for which WSGI application would be getting delegated to a daemon 
process.

If the context is not that for a daemon process, then default Module reloading 
method
is applied instead.

Original comment by Graham.Dumpleton@gmail.com on 9 Sep 2007 at 11:03

GoogleCodeExporter commented 9 years ago

Original comment by Graham.Dumpleton@gmail.com on 17 Sep 2007 at 5:43

GoogleCodeExporter commented 9 years ago
Version 2.0 of mod_wsgi now released with this feature.

Original comment by Graham.Dumpleton@gmail.com on 20 Mar 2008 at 4:50