I have a simple Python uwsgi app that follows the basic pattern:
def application(env, start_response):
... do something ...
... create some threads ...
... handover the work to the threads ...
start_response('200 OK', [('Content-Type','text/html')])
return result
My sysadmin is complaining that my app is not handling shutdown and he has to wait for uwsgi's timeout to kill the app processes each time he wants to restart the uwsgi service. Which, apparently, can take up to 30 seconds, time in which the service is unavailable.
Is there a specific signal or call that uwsgi sends the app when it wants to close it? How do I handle that?