@@ -1824,7 +1824,6 @@ impl VirtualFs {
18241824 info
18251825 } else {
18261826 let ( result_tx, result_rx) = tokio:: sync:: oneshot:: channel ( ) ;
1827- debug ! ( "streaming_commit: ino={}, sending Finish to worker..." , ino) ;
18281827 if channel. tx . send ( WriteMsg :: Finish ( result_tx) ) . await . is_err ( ) {
18291828 // Channel closed: only treat as success if already committed.
18301829 // If the worker died from an error, this is a real failure.
@@ -1872,23 +1871,12 @@ impl VirtualFs {
18721871 ops. push ( BatchOp :: DeleteFile { path : old_path. clone ( ) } ) ;
18731872 }
18741873
1875- let hub_start = std:: time:: Instant :: now ( ) ;
18761874 if let Err ( e) = self . hub_client . batch_operations ( & ops) . await {
1877- error ! (
1878- "Failed to commit file {}: {} ({:.1}s)" ,
1879- full_path,
1880- e,
1881- hub_start. elapsed( ) . as_secs_f64( )
1882- ) ;
1875+ error ! ( "Failed to commit file {}: {}" , full_path, e) ;
18831876 // CAS upload succeeded — preserve file_info for retry in release()
18841877 * channel. pending_info . lock ( ) . unwrap ( ) = Some ( file_info) ;
18851878 return Err ( libc:: EIO ) ;
18861879 }
1887- debug ! (
1888- "streaming_commit: ino={}, Hub commit done in {:.1}s" ,
1889- ino,
1890- hub_start. elapsed( ) . as_secs_f64( ) ,
1891- ) ;
18921880
18931881 // Update inode: clean, with hash
18941882 let mut inodes = self . inode_table . write ( ) . expect ( "inodes poisoned" ) ;
@@ -2891,68 +2879,22 @@ async fn streaming_worker(
28912879 error : Arc < std:: sync:: Mutex < Option < String > > > ,
28922880) {
28932881 let mut failed = false ;
2894- let mut total_bytes: u64 = 0 ;
2895- let mut chunk_count: u64 = 0 ;
2896- let start = std:: time:: Instant :: now ( ) ;
2897- let mut last_log = start;
28982882 while let Some ( msg) = rx. recv ( ) . await {
28992883 match msg {
29002884 WriteMsg :: Data ( data) => {
29012885 if failed {
29022886 continue ; // drain remaining messages
29032887 }
2904- let len = data. len ( ) as u64 ;
29052888 if let Err ( e) = writer. write ( & data) . await {
29062889 * error. lock ( ) . unwrap ( ) = Some ( e. to_string ( ) ) ;
29072890 failed = true ;
2908- continue ;
2909- }
2910- total_bytes += len;
2911- chunk_count += 1 ;
2912- let now = std:: time:: Instant :: now ( ) ;
2913- if now. duration_since ( last_log) . as_secs ( ) >= 5 {
2914- let elapsed = now. duration_since ( start) . as_secs_f64 ( ) ;
2915- let mb = total_bytes as f64 / ( 1024.0 * 1024.0 ) ;
2916- debug ! (
2917- "streaming_worker: received {:.1} MiB in {} chunks ({:.1} MiB/s, {:.1}s elapsed)" ,
2918- mb,
2919- chunk_count,
2920- mb / elapsed,
2921- elapsed,
2922- ) ;
2923- last_log = now;
29242891 }
29252892 }
29262893 WriteMsg :: Finish ( reply) => {
2927- let elapsed_write = start. elapsed ( ) ;
2928- let mb = total_bytes as f64 / ( 1024.0 * 1024.0 ) ;
2929- info ! (
2930- "streaming_worker: write phase done: {:.1} MiB in {} chunks, {:.1}s ({:.1} MiB/s)" ,
2931- mb,
2932- chunk_count,
2933- elapsed_write. as_secs_f64( ) ,
2934- mb / elapsed_write. as_secs_f64( ) . max( 0.001 ) ,
2935- ) ;
29362894 let result = if failed {
29372895 Err ( crate :: error:: Error :: Hub ( "streaming write failed" . into ( ) ) )
29382896 } else {
2939- let t0 = std:: time:: Instant :: now ( ) ;
2940- let res = writer. finish_boxed ( ) . await ;
2941- let fin_elapsed = t0. elapsed ( ) ;
2942- match & res {
2943- Ok ( info) => info ! (
2944- "streaming_worker: CAS finalize done in {:.1}s, hash={}, size={}" ,
2945- fin_elapsed. as_secs_f64( ) ,
2946- info. hash( ) ,
2947- info. file_size( ) ,
2948- ) ,
2949- Err ( e) => error ! (
2950- "streaming_worker: CAS finalize failed after {:.1}s: {}" ,
2951- fin_elapsed. as_secs_f64( ) ,
2952- e,
2953- ) ,
2954- }
2955- res
2897+ writer. finish_boxed ( ) . await
29562898 } ;
29572899 let _ = reply. send ( result) ;
29582900 return ;
0 commit comments