Happy vacation, Roberto! Thanks for the quick fix but isn`t it would be better to make uwsgi.disconnect() behave the same way as return or yield '' i.e. - not closing socket untill data send? I understand wsgi sepcification but uwsgi.disconnect() is not a part of it and it would be more natural to make it behave like return or yield '' imo. Additional option --start_response-nodelay seems like redundant in this case. I suppose it is very unlikely that someone ever will want to start_response() and then uwsgi.disconnect() to not send anything in response. (which is default now without --start_response-nodelay.)
2012/5/22 Roberto De Ioris <[email protected]>: > >> 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 -- -------------------------------------------- Турнаев Евгений Викторович +7 906 875 09 43 -------------------------------------------- _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
