Skip to content
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

Thread manager instantiation in the validator #4603

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion thread-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub use {
tokio_runtime::{TokioConfig, TokioRuntime},
};

pub const MAX_THREAD_NAME_CHARS: usize = 12;
pub const MAX_THREAD_NAME_CHARS: usize = 16;
alexpyattaev marked this conversation as resolved.
Show resolved Hide resolved

#[derive(Default, Debug)]
pub struct ThreadManagerInner {
Expand Down
2 changes: 1 addition & 1 deletion thread-manager/src/native_thread_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl<T> Drop for JoinHandle<T> {

impl NativeThreadRuntime {
pub fn new(name: String, cfg: NativeConfig) -> Self {
debug_assert!(name.len() < MAX_THREAD_NAME_CHARS, "Thread name too long");
debug_assert!(name.len() <= MAX_THREAD_NAME_CHARS, "Thread name too long");
Self {
inner: Arc::new(NativeThreadRuntimeInner {
id_count: AtomicUsize::new(0),
Expand Down
2 changes: 1 addition & 1 deletion thread-manager/src/rayon_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Deref for RayonRuntime {

impl RayonRuntime {
pub fn new(name: String, config: RayonConfig) -> anyhow::Result<Self> {
debug_assert!(name.len() < MAX_THREAD_NAME_CHARS, "Thread name too long");
debug_assert!(name.len() <= MAX_THREAD_NAME_CHARS, "Thread name too long");
let core_allocation = config.core_allocation.clone();
let chosen_cores_mask = Mutex::new(core_allocation.as_core_mask_vector());
let priority = config.priority;
Expand Down
2 changes: 1 addition & 1 deletion thread-manager/src/tokio_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl TokioRuntime {
}

pub fn new(name: String, cfg: TokioConfig) -> anyhow::Result<Self> {
debug_assert!(name.len() < MAX_THREAD_NAME_CHARS, "Thread name too long");
debug_assert!(name.len() <= MAX_THREAD_NAME_CHARS, "Thread name too long");
let num_workers = if cfg.worker_threads == 0 {
num_cpus::get()
} else {
Expand Down
Loading