-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[finagle-http2]: Add a per session request limit option to http2
See #954 for original description, and included imagery. Problem: When running finagle in a setup using HTTP/2 via application load balancers (ALB), the session is very likely subject to a limit on the number of requests. E.g. when running via NGINX, the request limit is 1K requests per connection by default. On AWS, ALB have a 10k request limit. This means that in setups that use finagle and ALBs for their L7 features, the session is subject to races happening on connection close regularly. Netty fires inactive channel for any request that is in flight for the closed session, leading Finagle to propagate a ChannelClosedException. There is no possible remediation for this race in Netty since Finagle manages sessions/connections. This condition can be easily reproduced by running a Finagle server & client with an ALB like NGINX in between, sending concurrent requests up until the limit. Solution: Allow configuration of a MaxRequestsPerSession option that aligns a session with underlying request limits. The number ofMaxConcurrentStreams is deducted to account for any requests in flight. When this number of requests is reached, mark the session as closed so it is shut down and a new session is created. This option is off by default and therefore opt-in. Result When the configured number of requests is reached, the session is terminated and a new session is opened Closes #954 Differential Revision: https://phabricator.twitter.biz/D1107613
- Loading branch information
1 parent
0c3a8a3
commit 610a21c
Showing
4 changed files
with
88 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters