On 2014-11-16 18:01, Roberto De Ioris wrote:
I do not have a "final" solution, as the whole "atexit" concept is a
real
mess to correctly manage (just look at the python plugin where we
needed
4-5 workarounds to avoid segfaults ;)
Well, assuming that "atexit" is called only when worker is idle (i.e.
not
processing a request or in any other handler), I see no problems, to be
honest :)
But if understand correctly you do not want processes to remain down,
you
want them to suddenly reload.
Something like that - though this is managed "automagically" as uwsgi
will
try to keep minimum number of workers running, thus it will respawn
the one which has exited (I do not mind if something will go down
for a longer time if there are still enough active workers).
Now adding a function to call at every master cycle will be something
to
think of, as you effectively do not want to bring down workers, but to
simply reload them.
This is an interesting approach, I'll investigate it - thanks!
It could be done more generic, though - something like
"register_idle_handler"
which will be called when worker is inactive for specified amount of
time,
thus giving freedom-of-choice back to workers/apps (instead of reloading
only).
/Al
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi