[PATCH] ngx_http_upstream state machine fixes

Maxim Dounin mdounin at mdounin.ru
Sat Mar 31 14:48:05 UTC 2012


On Fri, Mar 30, 2012 at 02:50:48PM +0200, Piotr Sikora wrote:

> Hi,
> >The major question seems to be "what should be done if we've not
> >yet sent full request, but already got response"?  Right now line
> >is drawn at "if we've got response header, we stop sending
> >request".  And if we move the line - we should clearly understand
> >where the new line is and why.
> While current approach seems acceptable for single request-response
> connections, I'm pretty sure that it can be source of corruption for
> keepalived connections (in case when
> backend doesn't read rest of the request after sending response or
> when backend wants to read rest of the request that wasn't
> completely sent).
> I see two possible solutions: either kill connection after such
> "incomplete" request is made or make sure to send whole request even
> if we receive response while doing so.
> Opinions?

I tend to think that connection should be closed in this case.  
And it's actually likely to be closed by an upstream server 

Maxim Dounin

More information about the nginx-devel mailing list