-
Notifications
You must be signed in to change notification settings - Fork 18
runtime renaming #68
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
runtime renaming #68
Conversation
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.
Summary of Changes
Hello @hzxuzhonghu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request refactors and renames several core components within the orion-proxy and orion-xds crates to improve clarity and align naming conventions with their specific purpose, particularly concerning the XDS runtime. The changes streamline the codebase by replacing generic 'service' terminology with more precise 'XDS' references, enhancing readability and maintainability.
Highlights
- XDS Runtime Renaming: The primary focus of this pull request is to rename various components related to the XDS (eXtensible Discovery Service) runtime. This includes renaming the
ServiceInfostruct toXDSConfiguration, and updating associated variables and function calls (e.g.,spawn_services_runtime_from_threadtospawn_xds_runtime_from_thread). - Refactoring of Runtime Spawning: The functions responsible for spawning proxy and XDS runtimes have been refactored. This includes simplifying the return types of
spawn_proxy_runtime_from_threadandspawn_xds_runtime_from_threadand adjusting error handling withintokio::select!blocks. - XDS Client Function Renaming: The core asynchronous function
spawn_serviceshas been renamed torun_xds_clientto better reflect its role in managing the XDS client. - Minor Code Simplifications: Unnecessary
ChildTaskassignments intokio::spawncalls have been removed, and variable names within the XDS client have been made more consistent (e.g.,outbound_request_streamtorequest_stream). - Development Environment Update: The
.gitignorefile has been updated to include.vscodedirectories, preventing IDE-specific files from being committed.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request primarily focuses on renaming components for clarity, such as ServiceInfo to XDSConfiguration. While many of these changes improve readability, I've identified two significant issues. First, a critical issue in orion-proxy/src/xds_configurator.rs where a background task is no longer properly managed, which could lead to a resource leak. Second, in orion-proxy/src/proxy.rs, an error returned from start_proxy is being ignored, potentially hiding runtime failures. I've provided code suggestions to address both of these problems.
|
ping @awgn @dawid-nowak |
orion-proxy/src/proxy.rs
Outdated
|
|
||
| #[derive(Debug, Clone)] | ||
| struct ServiceInfo { | ||
| struct XDSConfiguration { |
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.
Both the runtime and this data type have a more generic naming because they are not used only to startup the xDS runtime, but to startup a runtime that hosts multiple services that are not part of the data path: xDS updates, access logger, admin interface, tracing. We used to have an xDS naming before and changed it to Service now. I believe it would be wrong to rename it back to just XDS{Configuration,Runtime,..}.
orion-proxy/src/proxy.rs
Outdated
| } | ||
|
|
||
| fn spawn_services_runtime_from_thread( | ||
| fn spawn_xds_runtime_from_thread( |
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.
As per the ServiceInfo structure, I would not rename this free function name.
orion-proxy/src/proxy.rs
Outdated
|
|
||
| #[derive(Debug, Clone)] | ||
| struct ServiceInfo { | ||
| struct XDSConfiguration { |
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.
ServiceInfo includes a set of services to be run in a dedicated Tokio runtime. One of them is the XDS, but there are others tasks like for example access logs, metrics exporter and the admin interface. Not sure XDSConfiguration is the best name...
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.
cc @fciaccia ServiceInfo is not a concrete meaning, as to access logs, metrics exporter and the admin interface, they should have their own runtime
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.
It is debatable whether or not each service should have its own runtime. As of now, we have N runtimes for the data path and a single runtime for all the other control and accessory services. Initially this secondary runtime only had the xDS service running, so it made sense to start adding "services" to that.
The ServiceInfo structure itself exists only to accomodate a clippy warning that was signaling the spawn_services function to have too many arguments.
Just renaming the structure and relative functions is inconsistent in my opinion. If we want to rename the runtime, then we should also split the services into multiple runtimes as you suggest, but not as it is done in this current PR.
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.
Yeah, i realized it
wrote a comment on proxy.rs about ServiceInfo. The rest looks good to me. |
hzxuzhonghu
left a comment
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.
Ah, i see recent sync prs add metrics and accesslog. I will revert serviceInfo first, can refactor them later
001461d to
7c730bf
Compare
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
16d178e to
35bca98
Compare
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
| else => { | ||
| warn!("All listener manager channels are closed...exiting"); | ||
| return Err("All listener manager channels are closed...exiting".into()); | ||
| _ = ct.cancelled() => { |
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.
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.