I experimented with several WSGI servers and could not find a way to gracefully close them. What I mean by graceful is that the server stops listening () for new requests, but finishes processing all connections that were accepted (). Then the server process ends.
So far I have spent some time with FAPWS, Cherrypy, Tornado and wsgiref. It seems that no matter what I do, some of the clients get "Connection reset by peer".
Can someone direct me to a WSGI server that will handle this correctly? Or do you know how to configure one of these servers for a clean shutdown? I think my next step is to mock up a simple HTTP server that does what I want.
source
share