Hi,
On a vanilla Ubuntu 11.04 machine, I built uWSGI 0.9.8.5 and tried running
the following command line:
uwsgi --http 0.0.0.0:8080 --module test --grunt 1 --master 1
Where in test.py I had simply:
import uwsgi
import sys
def debug(s):
sys.stderr.write(s + '\n')
def application(environ, start_response):
output = 'OK!'
if 'grunt' in environ['REQUEST_URI']:
# passing True to grunt() so the parent will keep serving the
request
if not uwsgi.grunt(True):
debug("parent")
output = 'Grunt!'
else:
debug("worker")
# calling disconnect in the worker to disassociate the worker
from the request
uwsgi.disconnect()
debug("disconnected")
return
start_response('200 OK', [])
return [output]
This causes a segmentation fault after printing "worker" and before printing
"disconnected" on Ubuntu 11.04, but works fine on OSX. The segfault occurs
in natty's eglibc's fclose(), called from
plugins/python/uwsgi_pymodule.c:py_uwsgi_disconnect().
Of course, if I won't call uwsgi.disconnect() in the worker, the segfault
will not occur - but I thought that this will leave the worker keeping the
connection with the webserver busy and will not let the parent finish the
request and move on to other business.
Before I dig deeper into the segfault, is this something I'm doing wrong
with the grunt() and disconnect() APIs?
Thanks,
- Yaniv
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi