@@ -302,6 +302,7 @@ fn run_multi_thread(cli: Cli, seeds: &[&str], filter: UrlFilter) -> Result<(), D
302302 . remote_batch_size
303303 . unwrap_or ( DEFAULT_REMOTE_BATCH_SIZE )
304304 . max ( 1 ) ;
305+ let remote_channel_logs = partition_settings. remote_channel_logs ;
305306 let seeds_owned: Vec < String > = seeds. iter ( ) . map ( |s| s. to_string ( ) ) . collect ( ) ;
306307 let start = Instant :: now ( ) ;
307308
@@ -335,6 +336,7 @@ fn run_multi_thread(cli: Cli, seeds: &[&str], filter: UrlFilter) -> Result<(), D
335336 senders_clone,
336337 receiver,
337338 remote_batch_size,
339+ remote_channel_logs,
338340 ) ) )
339341 } ) ?) ;
340342 }
@@ -359,6 +361,7 @@ async fn run_shard_streaming(
359361 remotes : Arc < Vec < mpsc:: Sender < LinkBatch > > > ,
360362 inbox : mpsc:: Receiver < LinkBatch > ,
361363 remote_batch_size : usize ,
364+ remote_channel_logs : bool ,
362365) -> Result < ( ) , DynError > {
363366 let state = AppState :: new_with_shared ( filter, & shared) ?;
364367 seed_partitioned_frontier ( state. frontier . as_ref ( ) , & seeds, & partition) . await ;
@@ -383,7 +386,12 @@ async fn run_shard_streaming(
383386 } )
384387 } ;
385388
386- let router = Arc :: new ( ShardRouter :: new ( partition, remotes, remote_batch_size) ) ;
389+ let router = Arc :: new ( ShardRouter :: new (
390+ partition,
391+ remotes,
392+ remote_batch_size,
393+ remote_channel_logs,
394+ ) ) ;
387395 let mut workers = Vec :: new ( ) ;
388396 for id in 0 ..DEFAULT_AGENT_CAPACITY {
389397 workers. push ( spawn_streaming_worker_sharded (
@@ -828,6 +836,7 @@ struct ShardRouter {
828836 remotes : Arc < Vec < mpsc:: Sender < LinkBatch > > > ,
829837 batch_size : usize ,
830838 buffers : Arc < RemoteBuffers > ,
839+ log_channel_drop : bool ,
831840}
832841
833842#[ cfg( feature = "multi_thread" ) ]
@@ -836,12 +845,14 @@ impl ShardRouter {
836845 partition : ShardPartition ,
837846 remotes : Arc < Vec < mpsc:: Sender < LinkBatch > > > ,
838847 batch_size : usize ,
848+ log_channel_drop : bool ,
839849 ) -> Self {
840850 Self {
841851 partition,
842852 remotes,
843853 batch_size : batch_size. max ( 1 ) ,
844854 buffers : Arc :: new ( RemoteBuffers :: default ( ) ) ,
855+ log_channel_drop,
845856 }
846857 }
847858
@@ -876,10 +887,12 @@ impl ShardRouter {
876887 if let Some ( sender) = self . remotes . get ( shard) {
877888 let count = links. len ( ) ;
878889 if sender. send ( LinkBatch { depth, links } ) . await . is_err ( ) {
879- eprintln ! (
880- "shard {}: remote shard {shard} channel closed" ,
881- self . partition. index( )
882- ) ;
890+ if self . log_channel_drop {
891+ eprintln ! (
892+ "shard {}: remote shard {shard} channel closed" ,
893+ self . partition. index( )
894+ ) ;
895+ }
883896 } else {
884897 metrics. record_remote_shard_links ( count) ;
885898 }
0 commit comments