Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (12)
WalkthroughThis pull request introduces runtime naming functionality to Tokio. The changes add a new optional ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, 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 introduces a new feature allowing users to assign a custom name to their Tokio runtimes. This enhancement provides better identification and debugging capabilities for applications utilizing multiple runtimes or for clearer logging. The changes span across the core runtime builder, its handles, and the macro attributes, ensuring a consistent and user-friendly experience for setting and retrieving runtime names. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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 by creating a comment using either
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a name attribute for Tokio runtimes, which can be set via the Builder or the #[tokio::main] and #[tokio::test] macros. The name can then be retrieved using a new name() method on runtime::Handle. The implementation is consistent and well-tested, with updates to documentation and the addition of both unit and integration tests.
My main feedback is a suggestion to refactor a couple of internal functions that now have a large number of arguments. Using a configuration struct could improve maintainability.
🤖 Augment PR SummarySummary: Adds a configurable "runtime name" across Tokio’s runtime builder, scheduler handles, and proc-macro entrypoints. Changes:
Technical Notes: The name is stored on scheduler handles and returned as 🤖 Was this summary useful? React with 👍 or 👎 |
| kind: Kind, | ||
|
|
||
| /// Name of the runtime. | ||
| name: Option<String>, |
There was a problem hiding this comment.
Builder now has a name configuration, but impl fmt::Debug for Builder doesn’t include it, which can make debug output misleading when diagnosing runtime configuration. Consider including the name field in the debug struct output as well.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
value:good-to-have; category:bug; feedback: The Augment AI reviewer is correct! There is a custom implementation of std::fmt::Debug trait and the new name field is not added to it. Prevents missing to print the name of the runtime in its Debug implementation.
| .build() | ||
| .unwrap(); | ||
|
|
||
| assert_ne!(rt1.handle().name().unwrap(), rt2.handle().name().unwrap()); |
There was a problem hiding this comment.
This test currently only asserts that the two runtime names differ; it would miss bugs where the runtime name is set but doesn’t reflect the provided value. Consider also asserting that each handle().name() matches the corresponding input string.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
value:good-to-have; category:bug; feedback: The Augment AI reviewer is correct! The test makes sure that the two different runtimes have their own names which are not shared. It would be good to assert the names of each runtime too.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
|
||
| [dev-dependencies] | ||
| tokio = { version = "1.0.0", features = ["full", "test-util"] } | ||
| tokio = { version = "1.0.0", path = "../tokio", features = ["full", "test-util"] } |
There was a problem hiding this comment.
Redundant path dependency accidentally committed
Low Severity
The workspace root Cargo.toml already has [patch.crates-io] tokio = { path = "tokio" }, which automatically redirects all workspace members' tokio dependency to the local path. Adding an explicit path = "../tokio" to tokio-macros's [dev-dependencies] is therefore redundant. Notably, the tokio-macros/Cargo.toml header comment itself says "Remove path dependencies (if any)" before releasing, suggesting this was a local debugging artifact that wasn't cleaned up.
There was a problem hiding this comment.
value:annoying; category:bug; feedback: The Bugbot AI reviewer is not correct! The patch is used by most of the CI checks but some of them remove it to test a "pre-release". The "path" setting is needed for those pre-release checks.
|
test comment - please ignore |
|
PR Review posted successfully - ignore this comment |
Contributing to TokioThanks for your help improving Tokio! We are so happy to have you! There are opportunities to contribute to Tokio at any level. It doesn't matter if No contribution is too small and all contributions are valued. See the contributing guidelines to get started. Code of ConductThe Tokio project adheres to the Rust Code of Conduct. This describes Need Help?Reach out to us on the Discord server for any concern not covered in this guide. LTS guaranteesIn Tokio ≥1.0.0, each LTS release comes with the guarantee of at least one year of The goal of these guarantees is to provide stability to the ecosystem. Minimum Supported Rust Version (MSRV)
Versioning PolicyWith Tokio ≥1.0.0:
This is as defined by Semantic Versioning 2.0. |
|
[workspace] Internal"benches", [patch.crates-io] [workspace.metadata.spellcheck] [workspace.lints.rust] |
PR Review: rt: introduce runtime nameThis PR adds a Code Quality and Design1. The most notable design issue is that A better approach would be to include 2. In both 3. No use of the name beyond storage The runtime name is stored and retrievable, but not surfaced anywhere else: not in Tests4. The new test does not verify the actual stored name The test 5. Missing test for the All new test coverage is in 6. No test that an unnamed runtime returns There is no test verifying the default 7. No end-to-end test for the macro-level The compile-fail test for Documentation8. Since Input Validation9. No validation for empty string names
Cargo.toml10. Path dependencies are not permitted in published crates. The Summary
Overall this is a useful and well-scoped addition. The core implementation is correct: the name flows properly from the builder through both scheduler handles and is accessible via the public API. Addressing the test coverage and the |
value:useful; category:bug; feedback: The Claude AI reviewer is correct! There is no need the fields to be visible in the crate. The getter methods are visible and they should be used instead. |
value:good-to-have; category:bug; feedback: The Claude AI reviewer is correct! Adding more tests would prevent regressions in the future and would document the new functionality. |


7924: To review by AI