[Web-SIG] A 'shutdown' function in WSGI
ziade.tarek at gmail.com
Tue Feb 21 08:53:43 CET 2012
On Tue, Feb 21, 2012 at 2:39 AM, Graham Dumpleton <
graham.dumpleton at gmail.com> wrote:
> Overall the best chance of being able to do anything is relying on atexit.
> You are though at the mercy of the WSGI hosting mechanism shutting
> down the process and so the interpreter, in an orderly manner such
> that atexit callbacks get called.
> In Apache/mod_wsgi you get this guarantee, even in sub interpreters
> where atexit callbacks wouldn't normally be called when they are
> For uWSGI, atexit callbacks will not be called at the moment, by
> Robert is making changes to it so you get a guarantee there as well.
> It is possible he is only doing this though for case where main
> interpreter is being used, as doing it for sub interpreters is a bit
But I don't think you can guarantee that everything is still up in memory
by the time atexit gets called,
so you can't really call cleanup code there.
Any pure Python WSGI servers shouldn't have issues so long as they
> aren't force exiting the whole process and bypassing normal
> interpreter destruction.
what do you mean by bypassing its destruction ?
> Web-SIG mailing list
> Web-SIG at python.org
> Web SIG: http://www.python.org/sigs/web-sig
Tarek Ziadé | http://ziade.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Web-SIG