Skip to content

Conversation

gaius-qi
Copy link
Member

Description

This pull request refactors error handling in the stat method for both DfdaemonDownloadServerHandler and DfdaemonUploadServerHandler in the dragonfly-client project. The changes improve error logging and map specific errors to more appropriate gRPC statuses.

Error handling improvements:

  • Updated the stat method in DfdaemonDownloadServerHandler to use a match block for handling the result of the task.stat call. Added detailed error logging with task_id context and mapped ClientError::TaskNotFound to a Status::not_found gRPC status, while other errors are mapped to Status::internal. (dragonfly-client/src/grpc/dfdaemon_download.rs, dragonfly-client/src/grpc/dfdaemon_download.rsL707-R728)

  • Applied the same refactoring to the stat method in DfdaemonUploadServerHandler, ensuring consistent error handling, detailed logging, and specific gRPC status mapping for ClientError::TaskNotFound. (dragonfly-client/src/grpc/dfdaemon_upload.rs, dragonfly-client/src/grpc/dfdaemon_upload.rsL672-R693)

Related Issue

Motivation and Context

Screenshots (if appropriate)

…k stat

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi added this to the v2.4.0 milestone Jul 23, 2025
@gaius-qi gaius-qi self-assigned this Jul 23, 2025
@gaius-qi gaius-qi requested a review from a team as a code owner July 23, 2025 09:50
@gaius-qi gaius-qi added the enhancement New feature or request label Jul 23, 2025
@gaius-qi gaius-qi requested review from garenwen, BraveY and eryugey July 23, 2025 09:50
…sponse

Signed-off-by: Gaius <gaius.qi@gmail.com>
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

@chlins chlins enabled auto-merge (squash) July 23, 2025 09:51
Copy link
Contributor

@LunaWhispers LunaWhispers left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

codecov bot commented Jul 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Project coverage is 47.23%. Comparing base (10c7311) to head (a23b1e0).
Report is 1 commits behind head on main.

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

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1251      +/-   ##
==========================================
- Coverage   47.26%   47.23%   -0.03%     
==========================================
  Files          60       60              
  Lines       14583    14591       +8     
==========================================
  Hits         6892     6892              
- Misses       7691     7699       +8     
Files with missing lines Coverage Δ
dragonfly-client/src/grpc/dfdaemon_download.rs 0.00% <0.00%> (ø)
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.

@chlins chlins merged commit 74ab386 into main Jul 23, 2025
7 checks passed
@chlins chlins deleted the feature/stat branch July 23, 2025 10:06
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.

6 participants