I'm using flup.server.fcgi. When there is an uncatched exceptions (so that flup would usually translate it into nice html) there is an infinite block if the file containing the WSGIServer().run() call is not the main file (e.g. it is imported by another file).
I'm pretty sure that's a threading related problem. The problem does not exist when using flup.server.fcgi_fork.
Test case:
def Application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
raise RuntimeError('Expected exception')
return ['Hello World!\n']
from flup.server.fcgi_fork import WSGIServer
WSGIServer(Application, bindAddress='/tmp/app.fcgi.sock').run()
Starting the server using app.py (./app.py) everything works as expected. Starting it through ./breaks.py I never get an answer to the request (no browser bug, same behaviour with curl).
I'm using lighttpd for testing, but I'm pretty sure it's irrelevant.
Anyway, here is my config file:
server.modules = (
"mod_access",
"mod_fastcgi"
)
server.document-root = "/tmp/webinterface/public"
server.bind = "127.0.0.1"
server.port = 8000
fastcgi.server = ( "/sceradon" => ((
"socket" => "/tmp/app.fcgi.sock",
"check-local" => "disable"
)))