> Hello.
>     I just run into issue with uwsgi 1.2.3
>     When i do start_response() with status code "302 Found"
>     and header [('Connection', 'close'), ('Content-Type',
> 'text/html'), ('Location', 'http://ru.wikipedia.org/wiki/IPad')]
>     and then uwsgi.disconnect() after that nginx says 502 and spits
> out to error log:
>
> 2012/05/22 16:38:12 [error] 54019#0: *132735 upstream prematurely
> closed connection while reading response header from upstream, client:
> 81.19.90.149, server: localhost, request: "GET
> /cl?rex=0317D303E1FD2880&block=serp&st=1337690100&id=title_2&rnd=0.9527389095164835&_URL=http%3A//ru.wikipedia.org/wiki/IPad&yid=1337690100161757-1049739571324732019445193-4-009-XML&ruid=0000001D4F7D452C7D2C470D00000201
> HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi_hypernova.sock:",
> host: "....ru", referrer: "http://....ru/serp?query=ipad";
>
> Same application works ok with uwsgi 1.1.2.
>

Quick fix:

add --start_response-nodelay

or add

yield ""

after start_reponse() call in your code.

Boring reason for the change:

Older uWSGI releases had a non-standard start_rensponse() implementation.
WSGI says start_response has to not send output to the client til the
function returns or yield. Calling uwsgi.disconnect() will now result in
non sending the output generated by start_response().

You can be sure --start_response-nodelay will remains in uWSGI as i need
to use it for other projects too.

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

Reply via email to