@@ -330,12 +330,18 @@ pub async fn load_or_build_dataframe_cached(
330330 drive : char ,
331331 ttl_seconds : u64 ,
332332) -> crate :: Result < uffs_polars:: DataFrame > {
333+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached: ENTER drive={drive}" ) ;
333334 // Use spawn_blocking to run all MFT reading and polars operations on a
334335 // dedicated blocking thread. This avoids nested tokio runtime issues since
335336 // polars uses tokio internally for some operations.
336- tokio:: task:: spawn_blocking ( move || load_or_build_dataframe_cached_sync ( drive, ttl_seconds) )
337- . await
338- . map_err ( |e| crate :: MftError :: InvalidInput ( format ! ( "Task join error: {e}" ) ) ) ?
337+ let result = tokio:: task:: spawn_blocking ( move || {
338+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached: INSIDE spawn_blocking drive={drive}" ) ;
339+ load_or_build_dataframe_cached_sync ( drive, ttl_seconds)
340+ } )
341+ . await
342+ . map_err ( |e| crate :: MftError :: InvalidInput ( format ! ( "Task join error: {e}" ) ) ) ?;
343+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached: EXIT drive={drive}" ) ;
344+ result
339345}
340346
341347/// Synchronous version of `load_or_build_dataframe_cached`.
@@ -351,16 +357,24 @@ fn load_or_build_dataframe_cached_sync(
351357 use crate :: reader:: MftReader ;
352358 use crate :: usn:: query_usn_journal;
353359
360+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached_sync: ENTER drive={drive}" ) ;
361+
354362 // Try to load from cache first
355363 if let Some ( ( index, _header) ) = load_cached_index ( drive, ttl_seconds) {
364+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached_sync: cache HIT, calling to_dataframe" ) ;
356365 tracing:: info!( drive = %drive, records = index. records. len( ) , "📦 Cache hit - converting to DataFrame" ) ;
357- return index. to_dataframe ( ) ;
366+ let df = index. to_dataframe ( ) ;
367+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached_sync: to_dataframe done" ) ;
368+ return df;
358369 }
359370
360371 // Cache miss - read fresh
372+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached_sync: cache MISS, reading MFT fresh" ) ;
361373 tracing:: info!( drive = %drive, "📖 Cache miss - reading MFT fresh" ) ;
362374 let reader = MftReader :: open_sync ( drive) ?;
375+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached_sync: reader opened, calling read_all_index_sync" ) ;
363376 let index = reader. read_all_index_sync ( ) ?;
377+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached_sync: read_all_index_sync done, records={}" , index. len( ) ) ;
364378
365379 // Save to cache for next time
366380 let handle = VolumeHandle :: open ( drive) ?;
@@ -375,7 +389,10 @@ fn load_or_build_dataframe_cached_sync(
375389 }
376390
377391 // Convert to DataFrame
378- index. to_dataframe ( )
392+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached_sync: calling to_dataframe" ) ;
393+ let df = index. to_dataframe ( ) ;
394+ eprintln ! ( "[DEBUG] load_or_build_dataframe_cached_sync: to_dataframe done" ) ;
395+ df
379396}
380397
381398/// Multi-drive cache status for coordinated operations.
0 commit comments