Skip to content

Commit

Permalink
Upstream keepalive: clean read delayed flag in stored connections.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arut committed Nov 28, 2017
1 parent 53e5a74 commit e132687
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/http/modules/ngx_http_upstream_keepalive_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e132687

Please sign in to comment.