feat: Bump dragonfly-api to 2.1.49 and add local_only support for task stat #1250
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces several updates to the Dragonfly client, focusing on enhancing task handling, improving tracing, and standardizing headers. Key changes include adding a
local_only
flag to task status queries, extending task metadata handling for local storage, and renaming constants for clarity. Below is a breakdown of the most important changes:Enhancements to Task Handling:
local_only
flag to thestat_task
methods in bothDfdaemonDownloadServerHandler
andDfdaemonUploadServerHandler
, allowing task status to be queried exclusively from local storage. This includes updates to span recording and method signatures. (dragonfly-client/src/grpc/dfdaemon_download.rs
: [1] [2] [3];dragonfly-client/src/grpc/dfdaemon_upload.rs
: [4] [5] [6]stat
method in theTask
struct to support retrieving task metadata and pieces from local storage whenlocal_only
is true. This includes filtering unfinished pieces and constructing a detailedCommonTask
response. (dragonfly-client/src/resource/task.rs
: dragonfly-client/src/resource/task.rsL1838-R1908)Improvements to Tracing and Metrics:
local_only
flag in both download and upload server handlers for better observability. (dragonfly-client/src/grpc/dfdaemon_download.rs
: [1] [2];dragonfly-client/src/grpc/dfdaemon_upload.rs
: [3] [4]Header Standardization:
_HEADER
to their names (e.g.,DRAGONFLY_PIECE_LENGTH
toDRAGONFLY_PIECE_LENGTH_HEADER
). Updated all references accordingly, including tests and utility functions. (dragonfly-client/src/proxy/header.rs
: [1] [2] [3] [4]DRAGONFLY_TASK_DOWNLOAD_FINISHED_HEADER
, to indicate when a task download is complete. Added logic to include this header in responses. (dragonfly-client/src/proxy/header.rs
: [1];dragonfly-client/src/proxy/mod.rs
: [2]Codebase Enhancements:
get_all
method to thePiece
struct for retrieving all pieces of a task from local storage. (dragonfly-client/src/resource/piece.rs
: dragonfly-client/src/resource/piece.rsR147-R151)HashMap
) and minor refactoring in theTask
struct to support new functionality. (dragonfly-client/src/resource/task.rs
: [1] [2] [3]Dependency Update:
dragonfly-api
dependency version from2.1.47
to2.1.49
inCargo.toml
. (Cargo.toml
: Cargo.tomlL32-R32)Related Issue
Motivation and Context
Screenshots (if appropriate)