comparison src/http/modules/ngx_http_upstream_keepalive_module.c @ 7165:1cb92a2d672e

Upstream keepalive: clean read delayed flag in stored connections. If a connection with the read delayed flag set was stored in the keepalive cache, and after picking it from the cache a read timer was set on that connection, this timer was considered a delay timer rather than a socket read event timer as expected. The latter timeout is usually much longer than the former, which caused a significant delay in request processing. The issue manifested itself with proxy_limit_rate and upstream keepalive enabled and exists since 973ee2276300 (1.7.7) when proxy_limit_rate was introduced.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 28 Nov 2017 14:00:00 +0300
parents adf25b8d0431
children 46174066b75f
comparison
equal deleted inserted replaced
7164:044cb349fd3c 7165:1cb92a2d672e
338 item->connection = c; 338 item->connection = c;
339 339
340 pc->connection = NULL; 340 pc->connection = NULL;
341 341
342 if (c->read->timer_set) { 342 if (c->read->timer_set) {
343 c->read->delayed = 0;
343 ngx_del_timer(c->read); 344 ngx_del_timer(c->read);
344 } 345 }
345 if (c->write->timer_set) { 346 if (c->write->timer_set) {
346 ngx_del_timer(c->write); 347 ngx_del_timer(c->write);
347 } 348 }