Skip to content

rayon-threadlimit: Deprecate get_max_thread_count()#7071

Merged
steviez merged 2 commits intoanza-xyz:masterfrom
steviez:deprecate_rayon_threadlimit
Jul 23, 2025
Merged

rayon-threadlimit: Deprecate get_max_thread_count()#7071
steviez merged 2 commits intoanza-xyz:masterfrom
steviez:deprecate_rayon_threadlimit

Conversation

@steviez
Copy link
Copy Markdown

@steviez steviez commented Jul 22, 2025

Problem

See #105 for more context, but the TLDR is that solana-rayon-threadlimit was a workaround for a time when we did't have finer controls over individual threadpool sizes. CLI args have been wired up in many locations so there is no need for the environment variable hack that solana-rayon-threadlimit provides.

Summary of Changes

Deprecate get_max_thread_count() and remove all usage from our codebase.

Some subsequent PR's will get us towards deprecating get_thread_count() and thus the entire solana-rayon-threadlimit crate. I could also see us trying to limit callers of num_cpus::get() in the future to a few specific places, but small steps for now 😄

@steviez steviez force-pushed the deprecate_rayon_threadlimit branch 2 times, most recently from 8727438 to 1b426b7 Compare July 22, 2025 04:47
@steviez steviez changed the title rayon_threadlimit: Deprecate get_max_thread_count() rayon-threadlimit: Deprecate get_max_thread_count() Jul 22, 2025
@steviez steviez force-pushed the deprecate_rayon_threadlimit branch 3 times, most recently from 192a1f1 to 3e93022 Compare July 22, 2025 05:08
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 22, 2025

Codecov Report

Attention: Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.

Project coverage is 83.2%. Comparing base (222d32e) to head (c678eef).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #7071     +/-   ##
=========================================
- Coverage    83.2%    83.2%   -0.1%     
=========================================
  Files         854      854             
  Lines      374653   374660      +7     
=========================================
+ Hits       312058   312061      +3     
- Misses      62595    62599      +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread validator/src/cli/thread_args.rs
@steviez steviez requested a review from bw-solana July 22, 2025 06:59
Copy link
Copy Markdown

@bw-solana bw-solana left a comment

Choose a reason for hiding this comment

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

My only concern is that we might silently rug someone that is using the SOLANA_RAYON_THREADS env var.

I'm wondering if we can detect when that is set while initializing MAX_RAYON_THREADS and print a warn or something

Comment thread poh/Cargo.toml
Comment thread validator/src/cli/thread_args.rs
@steviez
Copy link
Copy Markdown
Author

steviez commented Jul 22, 2025

My only concern is that we might silently rug someone that is using the SOLANA_RAYON_THREADS env var.

I'm wondering if we can detect when that is set while initializing MAX_RAYON_THREADS and print a warn or something

Oops, realized I never responded to this piece. SOLANA_RAYON_THREADS was a hack and never officially documented which is why I went straight for ripping it out. I guess it would be friendlier to add a warn! like you said

steviez added 2 commits July 22, 2025 17:30
This function provided a hack to change threadpool sizes to avoid
observed performance issues. The users of this function have since been
updated to have CLI args wired up to control the threadpool sizes. So,
the hack is no longer necessary and can be deprecated
@steviez steviez force-pushed the deprecate_rayon_threadlimit branch from 212e6f3 to c678eef Compare July 22, 2025 22:30
Copy link
Copy Markdown

@bw-solana bw-solana left a comment

Choose a reason for hiding this comment

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

LGTM

@steviez steviez merged commit 94c3c84 into anza-xyz:master Jul 23, 2025
52 checks passed
@steviez steviez deleted the deprecate_rayon_threadlimit branch July 23, 2025 01:47
puhtaytow pushed a commit to puhtaytow/agave that referenced this pull request Jul 24, 2025
This function provided a hack to change threadpool sizes to avoid
observed performance issues. The users of this function have since been
updated to have CLI args wired up to control the threadpool sizes. So,
the hack is no longer necessary and can be deprecated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants