Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support download persistent cache task from parents #950

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

gaius-qi
Copy link
Member

Description

This pull request includes several updates and improvements to the dragonfly-client project, focusing on enhancing the persistent cache functionality and improving error handling. The most important changes are summarized below:

Persistent Cache Enhancements:

  • Added multiple new methods to the Storage implementation in dragonfly-client-storage/src/lib.rs to handle persistent cache pieces, including methods for starting, finishing, failing, uploading, and checking the existence of persistent cache pieces. [1] [2]
  • Updated the IDGenerator implementation in dragonfly-client-util/src/id_generator/mod.rs to generate a more robust persistent cache task ID using SHA-256 hashing.

Error Handling Improvements:

  • Modified the DfdaemonDownload implementation in dragonfly-client/src/grpc/dfdaemon_download.rs to use send_timeout for error messages, ensuring that errors are handled within a specified timeout period. [1] [2] [3] [4]
  • Improved error logging and handling for persistent cache tasks in the DfdaemonDownload implementation, including more descriptive error messages and additional error handling for failed tasks. [1] [2] [3] [4]

Configuration Updates:

  • Updated the Cargo.toml file to use version 2.1.11 of the dragonfly-api crate.
  • Enhanced the DfdaemonUploadServer configuration in dragonfly-client/src/grpc/dfdaemon_upload.rs by adding TCP and HTTP2 keepalive settings.

These changes collectively improve the robustness, reliability, and maintainability of the dragonfly-client project.

Related Issue

Motivation and Context

Screenshots (if appropriate)

@gaius-qi gaius-qi added the enhancement New feature or request label Jan 21, 2025
@gaius-qi gaius-qi added this to the v2.3.0 milestone Jan 21, 2025
@gaius-qi gaius-qi self-assigned this Jan 21, 2025
@gaius-qi gaius-qi requested a review from a team as a code owner January 21, 2025 12:44
@gaius-qi gaius-qi force-pushed the feature/persistent branch 2 times, most recently from ea0b31d to 366ac86 Compare January 21, 2025 12:49
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 0.60606% with 492 lines in your changes missing coverage. Please review.

Project coverage is 32.66%. Comparing base (2d4c54d) to head (9a704d8).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
dragonfly-client/src/grpc/dfdaemon_upload.rs 0.00% 226 Missing ⚠️
dragonfly-client/src/resource/piece_collector.rs 0.00% 92 Missing ⚠️
dragonfly-client/src/grpc/dfdaemon_download.rs 0.00% 48 Missing ⚠️
...onfly-client/src/resource/persistent_cache_task.rs 0.00% 33 Missing ⚠️
dragonfly-client/src/resource/piece.rs 0.00% 32 Missing ⚠️
dragonfly-client/src/proxy/mod.rs 0.00% 24 Missing ⚠️
dragonfly-client/src/resource/piece_downloader.rs 0.00% 20 Missing ⚠️
dragonfly-client-storage/src/lib.rs 0.00% 13 Missing ⚠️
dragonfly-client/src/resource/task.rs 0.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #950      +/-   ##
==========================================
- Coverage   34.05%   32.66%   -1.39%     
==========================================
  Files          60       60              
  Lines        9395     9792     +397     
==========================================
  Hits         3199     3199              
- Misses       6196     6593     +397     
Files with missing lines Coverage Δ
dragonfly-client-util/src/id_generator/mod.rs 100.00% <100.00%> (ø)
dragonfly-client/src/resource/task.rs 0.00% <0.00%> (ø)
dragonfly-client-storage/src/lib.rs 1.42% <0.00%> (-0.33%) ⬇️
dragonfly-client/src/resource/piece_downloader.rs 4.65% <0.00%> (-4.05%) ⬇️
dragonfly-client/src/proxy/mod.rs 0.00% <0.00%> (ø)
dragonfly-client/src/resource/piece.rs 55.51% <0.00%> (-6.44%) ⬇️
...onfly-client/src/resource/persistent_cache_task.rs 0.00% <0.00%> (ø)
dragonfly-client/src/grpc/dfdaemon_download.rs 0.00% <0.00%> (ø)
dragonfly-client/src/resource/piece_collector.rs 0.00% <0.00%> (ø)
dragonfly-client/src/grpc/dfdaemon_upload.rs 0.00% <0.00%> (ø)

@gaius-qi gaius-qi merged commit d4096db into main Jan 21, 2025
6 checks passed
@gaius-qi gaius-qi deleted the feature/persistent branch January 21, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants