]> git.kaiwu.me - nginx.git/commit
Upstream: fixed timeouts with gRPC, SSL and select (ticket #2229).
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 20 Aug 2021 00:53:56 +0000 (03:53 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 20 Aug 2021 00:53:56 +0000 (03:53 +0300)
commitc231640eba9e26e963460c83f2907ac6f9abf3fc
tree0b51366151e93085b2067ea75d9f3a63d1ddb4e7
parentd4dad02e5ecd523f896a87a08a6582853d83a14d
Upstream: fixed timeouts with gRPC, SSL and select (ticket #2229).

With SSL it is possible that an established connection is ready for
reading after the handshake.  Further, events might be already disabled
in case of level-triggered event methods.  If this happens and
ngx_http_upstream_send_request() blocks waiting for some data from
the upstream, such as flow control in case of gRPC, the connection
will time out due to no read events on the upstream connection.

Fix is to explicitly check the c->read->ready flag if sending request
blocks and post a read event if it is set.

Note that while it is possible to modify ngx_ssl_handshake() to keep
read events active, this won't completely resolve the issue, since
there can be data already received during the SSL handshake
(see 573bd30e46b4).
src/http/ngx_http_upstream.c