http/2: remove upstream max concurrent streams check#981
http/2: remove upstream max concurrent streams check#981mattklein123 merged 9 commits intoenvoyproxy:masterfrom jwfang:issue963
Conversation
|
@jwfang in thinking about this a bit more, I think we should just delete the check on the client side connection pool: https://github.com/lyft/envoy/blob/master/source/common/http/http2/conn_pool.cc#L85 Basically, delete that line and remove all occurrences of maxConcurrentStreams() function. The reason for this is that we already have protection via circuit breakers. There is no point in having additional protection (other than potentially for push, which we don't support currently, and can deal with later). If we overflow the other side, the code will correctly handle the REFUSED_STREAM reset that happens. This should still be configurable on the listener side of things, but that could be done in a different change if you want if that is not a problem that you have. |
|
great, that's what i am confused too. in theory, for upstream connection, i think we need to check against MAX_STREAM setting from the server, not envoy's limit. i will do it as you suggested when at the office. for listener side MAX_STREAM, can you give me some guide ? |
|
BTW, do you know what's the behaviour for nghttp2 when we overflow MAX_STREAM? |
|
This is a little confusing so I will discuss upstream and listener side independently. Both sides: it comes down to actually setting max concurrent streams in the http/2 settings frame here: https://github.com/lyft/envoy/blob/master/source/common/http/http2/codec_impl.cc#L509. Currently we do this the same for both client and server connections. The client side connection actually doesn't do anything, since this only affects the number of allowed incoming streams. It would effect push streams, but we don't support that currently, so it's effectively NOP. Upstream: So for upstream, the settings frame basically does nothing, which is why the check should be removed. I think I originally added this since we run Envoy everywhere in an http/2 mesh and at some point it made sense to do an early check since I know what the other side is doing. However in general, this makes no sense, so just kill the check entirely. IIRC nghttp2 will auto fail a new stream locally if it knows the remote side can't take it. Envoy will correctly 503 the request. Optimally, we would listen to the incoming settings frame from the other side, and know what the limit is, and then fail it, with a good stat. We could file a different issue on doing that. Downstream/listener: If you don't care about this for your use case, I would just ignore in this PR and we can deal with it some other time and just note in the issue. If you do care, you basically have to plumb through the limit from the config all the way to the codec. Basically, figure out how |
This reverts commit 9070524.
The reason for this is that we already have protection via circuit breakers. There is no point in having additional protection (other than potentially for push, which we don't support currently, and can deal with later). If we overflow the other side, the code will correctly handle the REFUSED_STREAM reset that happens.
|
thanks for your detailed explanation. then are we going to remove the hard-coded max stream check ( this pull request)?
the later two issues maybe a little hard for me at the moment, but i will try to see if i can help. |
The reason for this is that we already have protection via circuit breakers. There is no point in having additional protection (other than potentially for push, which we don't support currently, and can deal with later). If we overflow the other side, the code will correctly handle the REFUSED_STREAM reset that happens.
|
@jwfang thanks, I think this is the right fix. Please sign the CLA: https://oss.lyft.com/cla/#/signature |
|
@mattklein123 signed |
Automatic merge from submit-queue. [DO NOT MERGE] Auto PR to update dependencies of proxy This PR will be merged automatically once checks are successful. ```release-note none ```
Description: update Envoy to f958d39. Format checker required moving away from std::unordered_map. Additionally, link stamping changed significantly. New bazel targets adapt to the new mechanisms. Risk level: increase in binary size, need to re-analyze #983 Testing: CI Signed-off-by: Jose Nino <jnino@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
Description: update Envoy to f958d39. Format checker required moving away from std::unordered_map. Additionally, link stamping changed significantly. New bazel targets adapt to the new mechanisms. Risk level: increase in binary size, need to re-analyze #983 Testing: CI Signed-off-by: Jose Nino <jnino@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
**Description** This commit adds support for configuring additional metrics labels corresponding to request headers. Notably, this adds a new flag to the controller `metricsRequestHeaderLabelMapping` that will be validated and propagated to the extproc. The flag is in the format of the comma separated key value pairs as in "header1:label1,header2:label2,..." Fixes #848 --------- Signed-off-by: Suren Raju <suren.raju@careem.com> Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
**Description** This fixes the naming for the additional label configuration from `metricsRequestHeaderLabelMapping` to `metricsRequestHeaderLabels`, and fixed a bug in helm. Additionally, this adds an end to end test case to verify this flag working. **Related Issues/PRs (if applicable)** Follow up on #981 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
**Description** Previously, we had "filterapi/x" package to enable advanced users to build their own extproc with some custom metrics handling. In practice, the only use case was to "add some headers as a labels of metrics". Now that #981 is in, that can be achieved without rebuilding extproc by themselves by utilizing the new flag. Therefore, this removes the package altogether to eliminate the unnecessary code. **Related Issues/PRs (if applicable)** Follow up on #981 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
try to implement #963 , for preview
current only upstream/client side of max stream config,
other thing to be done: