-
Notifications
You must be signed in to change notification settings - Fork 125
feat(l1,l2): name rayon threads for easier debugging #5269
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
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.
Pull Request Overview
This PR adds unique naming to Rayon worker threads to facilitate debugging and performance analysis. Previously, Rayon threads inherited the name of the calling thread, making it difficult to identify which threads were experiencing contention.
- Initializes the global Rayon thread pool with custom thread names
- Adds rayon dependency to the ethrex binary crate
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cmd/ethrex/ethrex.rs | Adds Rayon thread pool initialization with custom naming pattern in the main function |
| cmd/ethrex/Cargo.toml | Adds rayon workspace dependency to the ethrex binary crate |
| Cargo.lock | Updates dependency graph to include rayon for the ethrex binary |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| rayon::ThreadPoolBuilder::default() | ||
| .thread_name(|i| format!("rayon-worker-{i}")) | ||
| .build_global() | ||
| .expect("failed to build rayon threadpool"); |
Copilot
AI
Nov 11, 2025
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.
The error message uses 'threadpool' but it should be 'thread pool' (two words) for consistency with the standard terminology.
| .expect("failed to build rayon threadpool"); | |
| .expect("failed to build rayon thread pool"); |
Lines of code reportTotal lines added: Detailed view |
**Motivation** Rayon currently inherits the name of the thread that calls it first, which creates confusion when, for example, one tries to see which threads incur the most contention. **Description** Initialize the global thread pool on init to ensure the Rayon workers each have a unique name.
Motivation
Rayon currently inherits the name of the thread that calls it first, which creates
confusion when, for example, one tries to see which threads incur the most contention.
Description
Initialize the global thread pool on init to ensure the Rayon workers each have a
unique name.