Skip to content

Conversation

@hzxuzhonghu
Copy link
Member

No description provided.

@kmesh-bot kmesh-bot requested a review from dawid-nowak August 29, 2025 09:34
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 ServiceInfo struct to XDSConfiguration, and updating associated variables and function calls (e.g., spawn_services_runtime_from_thread to spawn_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_thread and spawn_xds_runtime_from_thread and adjusting error handling within tokio::select! blocks.
  • XDS Client Function Renaming: The core asynchronous function spawn_services has been renamed to run_xds_client to better reflect its role in managing the XDS client.
  • Minor Code Simplifications: Unnecessary ChildTask assignments in tokio::spawn calls have been removed, and variable names within the XDS client have been made more consistent (e.g., outbound_request_stream to request_stream).
  • Development Environment Update: The .gitignore file has been updated to include .vscode directories, 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@hzxuzhonghu
Copy link
Member Author

ping @awgn @dawid-nowak


#[derive(Debug, Clone)]
struct ServiceInfo {
struct XDSConfiguration {
Copy link
Contributor

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,..}.

}

fn spawn_services_runtime_from_thread(
fn spawn_xds_runtime_from_thread(
Copy link
Contributor

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.


#[derive(Debug, Clone)]
struct ServiceInfo {
struct XDSConfiguration {
Copy link
Contributor

@awgn awgn Sep 4, 2025

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...

Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, i realized it

@awgn
Copy link
Contributor

awgn commented Sep 4, 2025

ping @awgn @dawid-nowak

wrote a comment on proxy.rs about ServiceInfo. The rest looks good to me.

Copy link
Member Author

@hzxuzhonghu hzxuzhonghu left a 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

Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
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() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

@fciaccia @awgn Fixed the hack sender holder with a cancel token, we should use the token to support graceful shutdown of listener later

@kmesh-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit 59adc36 into kmesh-net:main Sep 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants