feat(dragonfly-client-storage): add write_piece_timeout to storage config and enhance piece download timeout handling This change introduces a `write_piece_timeout` configuration to the storage module, allowing customizable timeouts for writing pieces to storage (e.g., disk or cache). The default timeout is set to 90 seconds. The total timeout for piece operations now combines `download.piece was timeout` and `storage.write_piece_timeout`. Key changes include: - Added `write_piece_timeout` field to `Storage` config with default and serialization support. - Updated `wait_for_piece_finished` and `wait_for_piece_finished_by_task_id` to use combined timeout (`download.piece_timeout + storage.write_piece_timeout`). - Introduced `DownloadPieceFinished` error for piece download timeouts and refactored `download_piece_from_source_finished` and `download_piece_from_parent_finished` to enforce timeouts using `tokio::select!`. - Increased default `download.piece_timeout` from 60s to 120s for robustness. - Removed `wait_for_piece_count` debug logging to simplify code. - Updated tests to validate `write_piece_timeout` parsing. These changes improve timeout granularity and reliability for piece operations. Signed-off-by: Gaius <gaius.qi@gmail.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||