3838//! checks the queues to see if there are more parcels of work that can be spawned in a new worker
3939//! task.
4040
41- use crate :: rayon_manager:: RayonManager ;
4241use crate :: work_reprocessing_queue:: {
4342 QueuedBackfillBatch , QueuedColumnReconstruction , QueuedGossipBlock , ReprocessQueueMessage ,
4443} ;
@@ -48,7 +47,6 @@ use lighthouse_network::{MessageId, NetworkGlobals, PeerId};
4847use logging:: TimeLatch ;
4948use logging:: crit;
5049use parking_lot:: Mutex ;
51- use rayon:: ThreadPool ;
5250pub use scheduler:: work_reprocessing_queue;
5351use serde:: { Deserialize , Serialize } ;
5452use slot_clock:: SlotClock ;
@@ -61,7 +59,7 @@ use std::sync::Arc;
6159use std:: task:: Context ;
6260use std:: time:: { Duration , Instant } ;
6361use strum:: IntoStaticStr ;
64- use task_executor:: TaskExecutor ;
62+ use task_executor:: { RayonPoolType , TaskExecutor } ;
6563use tokio:: sync:: mpsc;
6664use tokio:: sync:: mpsc:: error:: TrySendError ;
6765use tracing:: { debug, error, trace, warn} ;
@@ -76,7 +74,6 @@ use work_reprocessing_queue::{
7674} ;
7775
7876mod metrics;
79- pub mod rayon_manager;
8077pub mod scheduler;
8178
8279/// The maximum size of the channel for work events to the `BeaconProcessor`.
@@ -810,7 +807,6 @@ pub struct BeaconProcessor<E: EthSpec> {
810807 pub network_globals : Arc < NetworkGlobals < E > > ,
811808 pub executor : TaskExecutor ,
812809 pub current_workers : usize ,
813- pub rayon_manager : RayonManager ,
814810 pub config : BeaconProcessorConfig ,
815811}
816812
@@ -1609,10 +1605,7 @@ impl<E: EthSpec> BeaconProcessor<E> {
16091605 }
16101606 Work :: ChainSegmentBackfill ( process_fn) => {
16111607 if self . config . enable_backfill_rate_limiting {
1612- task_spawner. spawn_blocking_with_rayon (
1613- self . rayon_manager . low_priority_threadpool . clone ( ) ,
1614- process_fn,
1615- )
1608+ task_spawner. spawn_blocking_with_rayon ( RayonPoolType :: LowPriority , process_fn)
16161609 } else {
16171610 // use the global rayon thread pool if backfill rate limiting is disabled.
16181611 task_spawner. spawn_blocking ( process_fn)
@@ -1681,17 +1674,16 @@ impl TaskSpawner {
16811674 }
16821675
16831676 /// Spawns a blocking task on a rayon thread pool, dropping the `SendOnDrop` after task completion.
1684- fn spawn_blocking_with_rayon < F > ( self , thread_pool : Arc < ThreadPool > , task : F )
1677+ fn spawn_blocking_with_rayon < F > ( self , rayon_pool_type : RayonPoolType , task : F )
16851678 where
16861679 F : FnOnce ( ) + Send + ' static ,
16871680 {
1688- self . executor . spawn_blocking (
1681+ self . executor . spawn_blocking_with_rayon (
16891682 move || {
1690- thread_pool. install ( || {
1691- task ( ) ;
1692- } ) ;
1683+ task ( ) ;
16931684 drop ( self . send_idle_on_drop )
16941685 } ,
1686+ rayon_pool_type,
16951687 WORKER_TASK_NAME ,
16961688 )
16971689 }
0 commit comments