Opened 6 years ago

Last modified 5 years ago

#1708 new defect

closed_nodes in h2c should define as ngx_uint_t

Reported by: zhengjinhuanHW@… Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.15.x
Keywords: http2 Cc:
uname -a: Linux ubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.15.6
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-stream --with-mail=dynamic

Description

When h2c->processing exceeds 256 and all streams are released, the h2c->close_nodes in ngx_http_v2_close_stream will roll over and become a small value, eventually causing the node in the h2c->closed queue to be unreusable in the ngx_http_v2_get_node_by_id function, eventually h2c->streams_index contains a lot of invalid nodes, resulting in low performance of ngx_http_v2_get_node_by_id, so the closed_nodes in h2c is recommended to be define as ngx_uint_t instead of unsigned closed_nodes:8;

Change History (2)

comment:1 by Maxim Dounin, 6 years ago

Thanks for the report, this indeed seems possible if http2_max_concurrent_streams is set to a large value.

comment:2 by Maxim Dounin, 5 years ago

Keywords: http2 added; h2c_closed_nodes removed
Note: See TracTickets for help on using tickets.