-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor resource manager #11182
Refactor resource manager #11182
Conversation
Signed-off-by: Tony Allen <[email protected]>
/wait |
Signed-off-by: Tony Allen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nice cleanup. Thank you!
merge conflict needs fixing /wait |
Signed-off-by: Tony Allen <[email protected]>
stats test still failing /wait |
Signed-off-by: Tony Allen <[email protected]>
@@ -286,7 +287,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithFakeSymbolTable) { | |||
// If you encounter a failure here, please see | |||
// https://github.com/envoyproxy/envoy/blob/master/source/docs/stats.md#stats-memory-tests | |||
// for details on how to fix. | |||
EXPECT_MEMORY_EQ(m_per_cluster, 44233); | |||
EXPECT_MEMORY_EQ(m_per_cluster, 44425); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qq: Why does the memory change here? I would expect no change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed it was because each cluster has its own resource manager and I'm fiddling with the resource type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what changes are you making that cause it to grow in size? Is it padding or something? cc @jmarantz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's because ManagedResourceImpl
has a concrete base class. All of that functionality used to be in the same class, and there's probably a difference in padding due to different ordering of the members between the two classes, or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK that's probably fine, it just seemed like a pretty large bump for no functionality change.
Can you merge master, I think it will fix coverage. Thank you! /wait |
Signed-off-by: Tony Allen <[email protected]>
remaining_(remaining) { | ||
remaining_.set(max); | ||
} | ||
~ResourceImpl() override { ASSERT(current_ == 0); } | ||
|
||
// Upstream::Resource | ||
bool canCreate() override { return current_ < max(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Isn't this equivalent to the base class implementation?
updateRemaining(); | ||
open_gauge_.set(canCreate() ? 0 : 1); | ||
open_gauge_.set(BasicResourceLimitImpl::canCreate() ? 0 : 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why BasicResourceLimitImpl::canCreate() instead of just canCreate()?
@@ -333,6 +334,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithRealSymbolTable) { | |||
// 2020/04/07 10661 35557 36000 fix clang tidy on master | |||
// 2020/04/23 10531 36281 36800 http: max stream duration upstream support. | |||
// 2020/05/05 10908 36345 36800 router: add InternalRedirectPolicy and predicate | |||
// 2020/05/13 10531 36537 44600 Refactor resource manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: upper limit remains at 36800
This patch separates the Resource class from the resource manager implementation and allows for resource limit tracking in other parts of the code base. Signed-off-by: Tony Allen <[email protected]> Signed-off-by: Lizan Zhou <[email protected]>
This patch separates the Resource class from the resource manager implementation and allows for resource limit tracking in other parts of the code base. Signed-off-by: Tony Allen <[email protected]> Signed-off-by: Lizan Zhou <[email protected]>
This patch separates the Resource class from the resource manager implementation and allows for resource limit tracking in other parts of the code base. Signed-off-by: Tony Allen <[email protected]>
This patch separates the Resource class from the resource manager implementation and allows for resource limit tracking in other parts of the code base. Signed-off-by: Tony Allen <[email protected]>
This patch separates the Resource class from the resource manager implementation and allows for resource limit tracking in other parts of the code base. Signed-off-by: Tony Allen <[email protected]> Signed-off-by: Lizan Zhou <[email protected]> Co-authored-by: Lizan Zhou <[email protected]>
This patch separates the Resource class from the resource manager implementation and allows for resource limit tracking in other parts of the code base. Signed-off-by: Tony Allen <[email protected]> Signed-off-by: Lizan Zhou <[email protected]> Co-authored-by: Lizan Zhou <[email protected]>
This patch separates the Resource class from the resource manager implementation and allows for resource limit tracking in other parts of the code base.
Risk Level: Low, no changes to functionality
Testing: New UT
Docs Changes: n/a
Release Notes: n/a
Relates to #11028