summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2017-11-28 14:00:00 +0300
committerRoman Arutyunyan <arut@nginx.com>2017-11-28 14:00:00 +0300
commite13268714fa3f57adbc7c3891db86b025d79eaf4 (patch)
treef6768ded5a993c64581392c961cc5a40bc89e614 /src
parent53e5a746bff6860607d0afced9de9854ad62c50f (diff)
downloadnginx-e13268714fa3f57adbc7c3891db86b025d79eaf4.tar.gz
nginx-e13268714fa3f57adbc7c3891db86b025d79eaf4.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_upstream_keepalive_module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_upstream_keepalive_module.c b/src/http/modules/ngx_http_upstream_keepalive_module.c
index 0048e6bce..90a226d91 100644
--- a/src/http/modules/ngx_http_upstream_keepalive_module.c
+++ b/src/http/modules/ngx_http_upstream_keepalive_module.c
@@ -340,6 +340,7 @@ ngx_http_upstream_free_keepalive_peer(ngx_peer_connection_t *pc, void *data,
pc->connection = NULL;
if (c->read->timer_set) {
+ c->read->delayed = 0;
ngx_del_timer(c->read);
}
if (c->write->timer_set) {