route: replace ENVOY_BUG to ENVOY_LOG#28875
Merged
wbpcode merged 5 commits intoenvoyproxy:mainfrom Aug 9, 2023
Merged
Conversation
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Member
Author
|
not sure is this a good solution. but at least better than do nothing. 😞 |
mattklein123
reviewed
Aug 7, 2023
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
added 2 commits
August 8, 2023 06:35
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
mattklein123
reviewed
Aug 9, 2023
| // The initial route maybe never be set or the cached route maybe cleared by the filters. | ||
| // This will force route refreshment if there is not a cached route to avoid potential | ||
| // route refreshment in the response filter chain. | ||
| cb->route(nullptr); |
Member
There was a problem hiding this comment.
So this is a NOP if the route is already cached? Just making sure we aren't doing extra work on this path for the common case?
Member
Author
There was a problem hiding this comment.
Yeah, if a route is already cached, then the route() will return directly and this calling will do nothing.
Router::RouteConstSharedPtr
ConnectionManagerImpl::ActiveStream::route(const Router::RouteCallback& cb) {
if (cached_route_.has_value()) {
return cached_route_.value();
}
refreshCachedRoute(cb);
return cached_route_.value();
}
mattklein123
approved these changes
Aug 9, 2023
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Aug 9, 2023
* route: replace ENVOY_BUG to ENVOY_LOG Signed-off-by: wbpcode <wangbaiping@corp.netease.com> * minor update Signed-off-by: wbpcode <wangbaiping@corp.netease.com> * fix test Signed-off-by: wbpcode <wangbaiping@corp.netease.com> * fix format Signed-off-by: wbpcode <wangbaiping@corp.netease.com> * revert envoybug change Signed-off-by: wbpcode <wangbaiping@corp.netease.com> --------- Signed-off-by: wbpcode <wangbaiping@corp.netease.com> Signed-off-by: Ryan Northey <ryan@synca.io>
jbohanon
pushed a commit
to solo-io/envoy-fork
that referenced
this pull request
Aug 11, 2023
* route: replace ENVOY_BUG to ENVOY_LOG Signed-off-by: wbpcode <wangbaiping@corp.netease.com> * minor update Signed-off-by: wbpcode <wangbaiping@corp.netease.com> * fix test Signed-off-by: wbpcode <wangbaiping@corp.netease.com> * fix format Signed-off-by: wbpcode <wangbaiping@corp.netease.com> * revert envoybug change Signed-off-by: wbpcode <wangbaiping@corp.netease.com> --------- Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: route: replace ENVOY_BUG to ENVOY_LOG
Additional Description:
To fix #28626.
To avoid holding the whole route table in a long time and accelarate the release of memory, we forbidden route refreshment or clear after the response headers are sent in the #26045. And an ENVOY_BUG was introduced to ensure that.
This work well in most case because in most case we never refresh route at response phase (and it make no sense). But there are some corner cases will result the ENVOY_BUG be triggerd unexpectedly.
There are two mainly corner cases:
In both cases above, if a response/encoder filter try to access route by
route()method, the ENVOY_BUG may be triggered.To resolve the problem, this PR do two things:
routerfilter will do this. And note the route still may be cleared by response/encode filters, but this case is more like filter bug and should be handled by the filter developers.)Risk Level: low.
Testing: n/a.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.