Welcome! Log In Create A New Profile

Advanced

Re: wrong $bytes_sent on nginx-1.8.0 if aio threads is enabled

Valentin V. Bartenev
May 15, 2015 04:38PM
On Friday 15 May 2015 17:45:44 George . wrote:
> Hi,
>
> I found following bug in nginx-1.8.0:
>
> if aio is configured with threads support - sometime (one in thousands
> requests) $bytes_sent contains only length of the header. I'm attaching my
> nginx.conf, build params and simple python script I'm using the reproduce
> this issue.
>
> Here is the output of test script when the problem appears:
> .
> .
> .
> received: 101700000 from access_log : 101700000 on 26 iteration
> 127.0.0.1 - - [15/May/2015 17:27:45] "GET /test HTTP/1.0" 200 -
> 127.0.0.1 - - [15/May/2015 17:27:47] "GET /test HTTP/1.0" 200 -
> received: 101700000 from access_log : 101700000 on 27 iteration
> 127.0.0.1 - - [15/May/2015 17:27:58] "GET /test HTTP/1.0" 200 -
> 127.0.0.1 - - [15/May/2015 17:28:00] "GET /test HTTP/1.0" 200 -
> received: 101700000 from access_log : 101690000 on 28 iteration
> test failed!!
>
> also in access_log file"
>
> .
> .
> .
> 10170 GET /test HTTP/1.1
> 10170 GET /test HTTP/1.1
> 10170 GET /test HTTP/1.1
> 170 GET /test HTTP/1.1
> 10170 GET /test HTTP/1.1
> 10170 GET /test HTTP/1.1
> .
> .
>

Thank you for the report.

It caused by a race condition between sendfile() task completion
and connection close notifications. If the latter comes first,
nginx logs that client prematurely closed connection.

Unfortunately, it's not easy to fix. I'll look at it later.

wbr, Valentin V. Bartenev

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

wrong $bytes_sent on nginx-1.8.0 if aio threads is enabled Attachments

George . 799 May 15, 2015 10:46AM

Re: wrong $bytes_sent on nginx-1.8.0 if aio threads is enabled

Valentin V. Bartenev 387 May 15, 2015 04:38PM

Re: wrong $bytes_sent on nginx-1.8.0 if aio threads is enabled

George . 506 June 26, 2015 10:48AM



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

Online Users

Guests: 165
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