Welcome! Log In Create A New Profile

Advanced

Re: r->headers_out.status = 0

Maxim Dounin
September 30, 2011 05:16AM
Hello!

On Thu, Sep 29, 2011 at 01:00:20PM +0300, Anatoli Marinov wrote:

> I invested more time to investigate the issue and I found something.
>
> Let's assume there is 2 nginx workers with pids 6362 and 6364 (they
> are actually 4 but only these 2 are interested).
> There are 3 parallel requests 10102, 10188 and 10232 for one and the
> same file.
>
> See the scenario. It describes the issue:
>
> --- context switch to 6362---
> 6362 - 10102 - begin (connection accepted)
> 6362 - 10102 - file do not exist in the cache
> 6362 - 10102 - upstream peer found
>
> --- context switch to 6364 ---
> 6364 - 10188 - begin (connection accepted)
> 6364 - 10188 - file do not exist in the cache
> 6364 - 10188 - upstream peer found
> 6364 - 10188 - header received (header size 369 bytes)
> 6364 - 10188 - file received
> 6364 - 10188 - file renamed (with header size 369 bytes)
> 6364 - 10188 - shared mem updated - header size 369 bytes
> 6364 - 10188 - success end
>
> --- context switch to 6362 ---
> 6362 - 10102 - header received (header size 373 bytes)
> 6362 - 10102 - file received
> 6362 - 10102 - file renamed (with header size 373 bytes)
> shared memory is not updated because the cpu context is switched
> or the process works in parallel on different cpu
>
> --- context switch to 6364 ---
> 6364 - 10232 - begin (connection accepted)
> 6364 - 10232 - record is found in shared memory - file exists
> (header size is 369 from shared mem)
> 6364 - 10232 - header is read from the file (but only first 369 bytes)
>
> --- context switch to 6362 ---
> 6362 - 10102 - shared mem updated - header size 373 bytes
> ....
> ....
>
> --- context switch to 6364 ---
> 6364 - 10232 - http header could not be parsed because there are
> missing 4 bytes
> 6364 - 10232 - failed end
>
> See the attached file. The scenario it taken from it.
> In general it is very hard for reproduction.
> I hit is 2-3 times for 10 000 000 requests. But the issue exists :).

Thanks for investigating this. I'll take a look how to fix this
properly.

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

r->headers_out.status = 0

toli 1962 September 21, 2011 08:20AM

Re: r->headers_out.status = 0

Maxim Dounin 731 September 21, 2011 12:20PM

Re: r->headers_out.status = 0 Attachments

toli 815 September 26, 2011 03:48AM

Re: r->headers_out.status = 0

Maxim Dounin 762 September 26, 2011 07:10AM

Re: r->headers_out.status = 0

toli 803 September 29, 2011 06:02AM

Re: r->headers_out.status = 0

Maxim Dounin 699 September 30, 2011 05:16AM

Re: r->headers_out.status = 0

toli 846 September 30, 2011 05:26AM

Re: r->headers_out.status = 0

Maxim Dounin 739 September 30, 2011 06:30AM

Re: r->headers_out.status = 0

toli 881 September 30, 2011 06:36AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 315
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready