[PATCH] always process short preread body

Denis F. Latypoff denis at gostats.ru
Thu Sep 25 18:51:01 MSD 2008


Hello Maxim,

Thursday, September 25, 2008, 9:40:56 PM, you wrote:

> 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!

Did you tried

	proxy_buffering off;
	keepalive_timeout 0;
	gzip off;

for these locations?

> 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).

yep, agreed 100%!

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

> Maxim Dounin


> __________ NOD32 3469 (20080924) Information __________

> This message was checked by NOD32 antivirus system.
> http://www.eset.com




-- 
Best regards,
 Denis                            mailto:denis at gostats.ru






More information about the nginx mailing list