I thought about sys.exit(1) too, but I need the worker to exit only after 
handling the current request (i.e. after returning from the WSGI callable and 
handing the output to the client).

Or is there something I'm missing here?

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Roberto De Ioris
Sent: Thursday, December 05, 2013 11:04 AM
To: uWSGI developers and users list
Subject: Re: [uWSGI] Killing Python worker after request completion


> Hey,
>
> what's the best way to somehow signal that the worker handling a request
> should be killed
> (and respawned by the master, of course) after finishing up with the
> current request, from Python code?
>
> My use case is something like
>
> def application(environ, start_response):
>   try:
>      #  ...
>   except TerribleError:    # Can only recover from this by reloading the
> worker
>     uwsgi.reload_me()  # or whatever
>     start_response(...)
>     return ["Oops!"]
>
> - Aarni
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>

sys.exit(1)

-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to