Hello all,

Hopefully I'm not asking an question that's been answered many times before; I've been unable to find anything via Google.

Short version:
When I attempt to stream data to a uwsgi server running a JSONRPC application, every other request fails with the error 'Error writing request body to server', even if the data is < 100B. This effect where the first request succeeds, the second fails, third succeeds, etc. is completely reproducible and constant. When I set up the client so that it buffers the request and then sends it all in one piece everything works normally. Also, if I start the server via wsgiref.simple_server.make_server.serve_forever() everything works normally.

More details:
I'm currently testing with Java code; the error can be toggled on by setting one of
http://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html#setFixedLengthStreamingMode%28int%29
http://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html#setChunkedStreamingMode%28int%29

Also, putting nginx in front of the server fixes the problem, presumably because nginx buffers the entire request before sending it to uwsgi.

Interestingly, if I sleep for at least 5s prior to each request, the problem is resolved. At 4s every second request fails.

The uwsgi command line is:
uwsgi --master --processes 20 --cheaper 4  \
--http :10000 --http-timeout 600 --pidfile pyservice.pid --daemonize uwsgi.log \
    --wsgi-file PyLogServer.py

My uwsgi version is pretty old, 1.4.4. Ubuntu is 12.04.

Any ideas what might be causing this problem / debugging suggestions? Are there any more details I could provide that might be useful?

Thanks, Gavin






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

Reply via email to