[PATCH] always process short preread body

Maxim Dounin mdounin at mdounin.ru
Thu Sep 25 18:40:56 MSD 2008


Hello!

On Thu, Sep 25, 2008 at 09:25:08PM +0900, John Fremlin wrote:

[...]
>>   From strace in your message, it looks like the real problems are:
>> 
>> 1. Backend, which hasn't closed connection after sending reply.
>
>Yes, the backend does not close.

Ok, so I was right and backend isn't http-complaint.

>> 2. The fact that nginx waits for connection close before it
>> realizes that request was completed, even if got 'Content-Length'
>> header and appropriate number of body bytes.
>
>And 3. nginx never forwards the body of the message after the time out,
>(even though it has read it) sending only the header
>with content-length!

Yep, thats another problem in nginx with handling such 
buggy backends.

>> The 1 isn't really related to nginx.  The 2 should be fixed, but
>> a) the patch doesn't do it (or at least doesn't do it properly)
>
>It does fix the problem . . . Sorry for destroying buffering!

The problem is that patch penalizes configurations with non-buggy 
backends in an attempt to solve problem with buggy ones.

I'm not SPEWS^W^W not Igor, but it looks for me that the chances 
the patch will be accepted is rather small.

On the other hand I've seen at least two similar reports in last 
month or two, and it will be good for nginx to accept such backend 
replies.  And handling of this situation correctly is anyway 
required to support persistent connections in future (if any).

I believe I will be able to reproduce the problem and I'll try to 
produce more correct patch as time permits.

Maxim Dounin





More information about the nginx mailing list