@@ -11,7 +11,6 @@ use std::future::Future;
1111use std:: hash:: { Hash , Hasher } ;
1212use std:: io:: ErrorKind ;
1313use std:: sync:: Arc ;
14- use std:: time:: Instant ;
1514use std:: { collections:: HashMap , io} ;
1615use tokio:: sync:: { Notify , RwLock } ;
1716
@@ -120,14 +119,8 @@ impl Cache {
120119 drop ( buffer_data) ;
121120 drop ( bucket_state_guard) ;
122121
123- let wait_start = Instant :: now ( ) ;
124122 let notified = notify. notified ( ) ;
125123 notified. await ;
126- let wait_elapsed = wait_start. elapsed ( ) ;
127- if wait_elapsed. as_millis ( ) > 10 {
128- tracing:: warn!( "Reader waited {}ms for buffer to be populated for chunk {:?}" ,
129- wait_elapsed. as_millis( ) , key) ;
130- }
131124 None // Loop back to re-check
132125 }
133126 }
@@ -184,14 +177,9 @@ impl Cache {
184177 drop ( buffer_data) ;
185178 drop ( bucket_state_guard) ;
186179
187- let wait_start = Instant :: now ( ) ;
188180 let notified = notify. notified ( ) ;
189181 notified. await ;
190- let wait_elapsed = wait_start. elapsed ( ) ;
191- if wait_elapsed. as_millis ( ) > 10 {
192- tracing:: warn!( "Reader waited {}ms for buffer to be populated for chunk {:?}" ,
193- wait_elapsed. as_millis( ) , key) ;
194- }
182+
195183 None // Loop back to re-check
196184 }
197185 }
@@ -369,7 +357,6 @@ impl Cache {
369357 } ;
370358
371359 // Wait for pins to be released before proceeding
372- let unpin_start = Instant :: now ( ) ;
373360 let actual_old_loc = loop {
374361 let st = entry. write ( ) . await ;
375362 match & * st {
@@ -396,17 +383,12 @@ impl Cache {
396383 }
397384 }
398385 } ;
399- let unpin_elapsed = unpin_start. elapsed ( ) ;
400- if unpin_elapsed. as_millis ( ) > 10 {
401- tracing:: warn!( "Waited {}ms for unpin of {:?}" , unpin_elapsed. as_millis( ) , key) ;
402- }
403386
404387 // Create notify and buffer for this chunk
405388 let notify = Arc :: new ( Notify :: new ( ) ) ;
406389 let buffer = Arc :: new ( RwLock :: new ( None ) ) ;
407390
408391 // Transition to Waiting state
409- let transition_start = Instant :: now ( ) ;
410392 {
411393 let mut st = entry. write ( ) . await ;
412394 * st = ChunkState :: Waiting {
@@ -416,28 +398,17 @@ impl Cache {
416398 }
417399
418400 // Read THIS chunk immediately
419- let read_start = Instant :: now ( ) ;
420401 let chunk_data = match reader ( key. clone ( ) , actual_old_loc. clone ( ) ) . await {
421402 Ok ( bytes) => bytes,
422403 Err ( e) => {
423404 // TODO: Implement proper rollback for previously processed chunks
424405 panic ! ( "Failed to read chunk {:?} during zone cleaning: {}" , key, e) ;
425406 }
426407 } ;
427- let read_elapsed = read_start. elapsed ( ) ;
428- if read_elapsed. as_millis ( ) > 10 {
429- tracing:: warn!( "Reader took {}ms for {:?}" , read_elapsed. as_millis( ) , key) ;
430- }
431408
432409 // Populate buffer
433410 * buffer. write ( ) . await = Some ( chunk_data. clone ( ) ) ;
434411
435- let total_waiting_window = transition_start. elapsed ( ) ;
436- if total_waiting_window. as_millis ( ) > 10 {
437- tracing:: warn!( "Chunk {:?} had Waiting state with None buffer for {}ms" ,
438- key, total_waiting_window. as_millis( ) ) ;
439- }
440-
441412 // Notify waiters
442413 notify. notify_waiters ( ) ;
443414
0 commit comments