Skip to content

Conversation

@gaius-qi
Copy link
Member

@gaius-qi gaius-qi commented Jan 5, 2026

Description

This pull request refactors the logic in both the download and upload gRPC server handlers to improve the order in which certain operations are performed after a download task succeeds. The main change is to ensure that the download_finished method is always called before checking for output path handling when the download is not a ranged request.

Key changes:

Refactoring task completion flow:

  • The call to task_manager_clone.download_finished is now always executed immediately after a successful download, regardless of whether the download is ranged or not, in both DfdaemonDownloadServerHandler and DfdaemonUploadServerHandler implementations (dragonfly-client/src/grpc/dfdaemon_download.rs, dragonfly-client/src/grpc/dfdaemon_upload.rs). [1] [2]

Conditional output path handling:

  • The check for download_clone.range.is_none() and the subsequent output path handling logic have been moved to occur after the download_finished call, ensuring proper task completion notification before any file system operations (dragonfly-client/src/grpc/dfdaemon_download.rs, dragonfly-client/src/grpc/dfdaemon_upload.rs). [1] [2]

Related Issue

Motivation and Context

Screenshots (if appropriate)

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi added this to the v2.4.0 milestone Jan 5, 2026
@gaius-qi gaius-qi self-assigned this Jan 5, 2026
@gaius-qi gaius-qi added the enhancement New feature or request label Jan 5, 2026
@github-actions github-actions bot requested review from chlins, jim3ma and yyzai384 January 5, 2026 10:13
@gaius-qi gaius-qi enabled auto-merge (squash) January 5, 2026 10:13
Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.78%. Comparing base (b06dc0b) to head (a877ce4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dragonfly-client/src/grpc/dfdaemon_download.rs 0.00% 7 Missing ⚠️
dragonfly-client/src/grpc/dfdaemon_upload.rs 0.00% 7 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1581      +/-   ##
==========================================
- Coverage   42.79%   42.78%   -0.01%     
==========================================
  Files          75       75              
  Lines       21211    21213       +2     
==========================================
  Hits         9077     9077              
- Misses      12134    12136       +2     
Files with missing lines Coverage Δ
dragonfly-client/src/grpc/dfdaemon_download.rs 2.50% <0.00%> (-0.01%) ⬇️
dragonfly-client/src/grpc/dfdaemon_upload.rs 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gaius-qi gaius-qi merged commit 937a4e1 into main Jan 5, 2026
9 checks passed
@gaius-qi gaius-qi deleted the feature/finished branch January 5, 2026 10:24
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.

3 participants