Skip to content

stats: change Stats::ScopePtr references to Stats::ScopeSharedPtr#19790

Merged
KBaichoo merged 16 commits intoenvoyproxy:mainfrom
jmarantz:shared-scopes
Feb 21, 2022
Merged

stats: change Stats::ScopePtr references to Stats::ScopeSharedPtr#19790
KBaichoo merged 16 commits intoenvoyproxy:mainfrom
jmarantz:shared-scopes

Conversation

@jmarantz
Copy link
Copy Markdown
Contributor

@jmarantz jmarantz commented Feb 3, 2022

Commit Message: Follow-up to #19791 which changed Stats::ScopePtr to really be a shared_ptr, leaving both ScopePtr and ScopeSharedPtr referencing the same type: std::shared_ptr<Stats::Scope>, and changing references within the Stats:: namespace. This PR changes all in-repo references to ScopePtr into ScopeSharedPtr.

After this PR we will still have the Stats::ScopePtr alias here for one more round, giving out-of-repo codebases a chance to remove the references. The final PR to remove ScopePtr should will just have that one-line change in it, so it would be easy to roll back if needed.

Additional Description: To reviewers: This PR is a strict rename between equivalent aliases, and though it hits a lot of files in it, it should be quick to go through. There are no semantic changes. Thank you!
Risk Level: low -- this is just changing a large number of references between two equivalent aliases.
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

…fined type.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #19790 was opened by jmarantz.

see: more, trace.

@jmarantz jmarantz changed the title stats: change Stats::Scope usage to shared_ptr, eliminating ScopePtr as a de… WiP stats: change Stats::Scope usage to shared_ptr, eliminating ScopePtr as a defined type. Feb 3, 2022
jmarantz added a commit that referenced this pull request Feb 16, 2022
…r, leaving ScopePtr alias behind (#19791)

Commit Message: To support an algorithmic solution to a long burst of CPU on admin /stats with a large # clusters, we need to hold scopes in shared pointers. This PR makes that change and updates the usage within stats to reference scopes as ScopeSharedPtr rather than ScopePtr, and adds enable_shared_from_this as a Scope super-class so existing APIs that pass Scope& don't need to change.

This leaves behind a ScopePtr alias to ScopeSharedPtr temporarily to (a) make this PR be reviewable and (b) avoid breaking other repos that may reference ScopePtr. It will be easier to submit this PR first, then a external repos can rename their references, and we can do a follow-up PR that removes ScopePtr to avoid longer term confusion. That PR would like like #19790 which has 90 changed files in addition to the semantic change. Once this is merged, that PR will just be a strict rename and will be a lot easier to review.

This PR blocks #19693 which implements the admin change requiring holding onto a shared scope ptr.

Additional Description:
Risk Level: low
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz changed the title WiP stats: change Stats::Scope usage to shared_ptr, eliminating ScopePtr as a defined type. WiP stats: change Stats::ScopePtr refs to Stats::ScopeSharedPtr Feb 17, 2022
@jmarantz
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #19790 (comment) was created by @jmarantz.

see: more, trace.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz marked this pull request as ready for review February 17, 2022 13:44
@jmarantz jmarantz changed the title WiP stats: change Stats::ScopePtr refs to Stats::ScopeSharedPtr stats: change Stats::ScopePtr references to Stats::ScopeSharedPtr Feb 17, 2022
@KBaichoo KBaichoo self-assigned this Feb 17, 2022
@KBaichoo
Copy link
Copy Markdown
Contributor

//test/extensions/network/dns_resolver/apple:apple_dns_impl_test FAILED TO BUILD

/wait

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
…re is coming from

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
Copy link
Copy Markdown
Contributor Author

I was not able to figure out what the MacOS build failure was, so I'm going to let this go through CI with zero changes and then I'll break this up into much smaller PRs to iterate through this name-change across the codebase.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, that sounds like a good strategy.

@KBaichoo KBaichoo merged commit d13f9c2 into envoyproxy:main Feb 21, 2022
@jmarantz jmarantz deleted the shared-scopes branch February 22, 2022 03:19
rojkov pushed a commit that referenced this pull request Feb 28, 2022
…extensions (#20073)

This is a continuation of #19790 this time hitting the extensions directories, but specifically excluding
the apple DNS resolver impl which has some issue with this rename that is hard to diagnose from the CI logs.

We'll come back to that one last.

Risk Level: low
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
jmarantz added a commit that referenced this pull request Apr 20, 2022
…eSharedPtr (#20888)

Commit Message: Follow-up to #19791, #19790 and #20871, finishing off all remaining ScopePtr references. One more PR to go which will be to remove the ScopePtr definition, but first need to make sure this doesn't break any references outside the repo.

Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
…eSharedPtr (envoyproxy#20888)

Commit Message: Follow-up to envoyproxy#19791, envoyproxy#19790 and envoyproxy#20871, finishing off all remaining ScopePtr references. One more PR to go which will be to remove the ScopePtr definition, but first need to make sure this doesn't break any references outside the repo.

Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants