Skip to content

Commit 39c71ee

Browse files
committed
Copy: Parallelize copy_volumes_with_progress with FuturesUnordered
Cross-volume batch copies of 3+ items now run up to min(src.max_concurrent_ops(), dst.max_concurrent_ops(), 32) streams in flight. Below the threshold (or when both sides return 1), it falls back to the original sequential loop unchanged. - Shared progress state: files_done / bytes_done / last_progress_time are hoisted to Arc<AtomicU{usize,U64}> / Arc<Mutex<Instant>> so tasks update them without clobbering each other. The 200 ms throttle keeps events at `<= 5/s` regardless of task count. - Abort on first error (F10): the driver returns Err on the first failing task; dropping FuturesUnordered cancels the rest, and each backend's writer.abort() / delete-partial path handles temp cleanup. - Concurrent partial cleanup: each in-flight task's destination path is tracked in a shared Arc<Mutex<Vec>>; cancel/error deletes all of them (rollback includes them, pure cancel just cleans them). - Conflict resolution stays pre-dispatch (F14): Stop-mode prompts block the whole batch, same as before, so racing tasks can't double-prompt. - Cancellation check at task start AND between chunks inside copy_single_path (unchanged per-file semantics).
1 parent 008e962 commit 39c71ee

1 file changed

Lines changed: 381 additions & 151 deletions

File tree

0 commit comments

Comments
 (0)