@@ -260,6 +260,8 @@ impl RunningTask {
260
260
let mut succeeded = false ;
261
261
let mut count: u32 = 0 ;
262
262
let mut span = self . span . child ( "run-fetch-chunk-task" ) . with_relay_parent ( self . relay_parent ) ;
263
+ let mut network_error_freq = gum:: Freq :: new ( ) ;
264
+ let mut canceled_freq = gum:: Freq :: new ( ) ;
263
265
// Try validators in reverse order:
264
266
while let Some ( validator) = self . group . pop ( ) {
265
267
// Report retries:
@@ -272,7 +274,10 @@ impl RunningTask {
272
274
. with_chunk_index ( self . request . index . 0 )
273
275
. with_stage ( jaeger:: Stage :: AvailabilityDistribution ) ;
274
276
// Send request:
275
- let resp = match self . do_request ( & validator) . await {
277
+ let resp = match self
278
+ . do_request ( & validator, & mut network_error_freq, & mut canceled_freq)
279
+ . await
280
+ {
276
281
Ok ( resp) => resp,
277
282
Err ( TaskError :: ShuttingDown ) => {
278
283
gum:: info!(
@@ -342,6 +347,8 @@ impl RunningTask {
342
347
async fn do_request (
343
348
& mut self ,
344
349
validator : & AuthorityDiscoveryId ,
350
+ nerwork_error_freq : & mut gum:: Freq ,
351
+ canceled_freq : & mut gum:: Freq ,
345
352
) -> std:: result:: Result < ChunkFetchingResponse , TaskError > {
346
353
gum:: trace!(
347
354
target: LOG_TARGET ,
@@ -386,7 +393,9 @@ impl RunningTask {
386
393
Err ( TaskError :: PeerError )
387
394
} ,
388
395
Err ( RequestError :: NetworkError ( err) ) => {
389
- gum:: debug!(
396
+ gum:: warn_if_frequent!(
397
+ freq: nerwork_error_freq,
398
+ max_rate: gum:: Times :: PerHour ( 100 ) ,
390
399
target: LOG_TARGET ,
391
400
origin = ?validator,
392
401
relay_parent = ?self . relay_parent,
@@ -400,7 +409,9 @@ impl RunningTask {
400
409
Err ( TaskError :: PeerError )
401
410
} ,
402
411
Err ( RequestError :: Canceled ( oneshot:: Canceled ) ) => {
403
- gum:: debug!(
412
+ gum:: warn_if_frequent!(
413
+ freq: canceled_freq,
414
+ max_rate: gum:: Times :: PerHour ( 100 ) ,
404
415
target: LOG_TARGET ,
405
416
origin = ?validator,
406
417
relay_parent = ?self . relay_parent,
0 commit comments