feat(grpc): add block list support for download and upload tasks#1660
Merged
feat(grpc): add block list support for download and upload tasks#1660
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1660 +/- ##
==========================================
+ Coverage 50.83% 50.86% +0.02%
==========================================
Files 83 84 +1
Lines 20029 20522 +493
==========================================
+ Hits 10182 10438 +256
- Misses 9847 10084 +237
🚀 New features to boost your workflow:
|
837e6cb to
f4b054b
Compare
gaius-qi
requested changes
Feb 9, 2026
Signed-off-by: chlins <chlins.zhang@gmail.com>
f4b054b to
5450f90
Compare
There was a problem hiding this comment.
Pull request overview
Adds dynamic block list enforcement to dfdaemon task handling and exposes new Prometheus counters to observe blocked download/upload attempts, using dynconfig-provided policy from the scheduler cluster.
Changes:
- Enforce block list checks in dfdaemon download/upload task RPC paths and return
PermissionDeniedwhen blocked (with new blocked-task metrics). - Introduce a
grpc::blocklistmodule and extend dynconfig to deserialize scheduler-provided client/seed-client block list configuration. - Add new Prometheus counters for blocked download/upload tasks and map gRPC
PermissionDeniedto HTTP403in the proxy.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| dragonfly-client/src/proxy/mod.rs | Maps gRPC PermissionDenied to HTTP 403 Forbidden for proxy-via-dfdaemon flow. |
| dragonfly-client/src/grpc/mod.rs | Exposes the new blocklist module in the gRPC module tree. |
| dragonfly-client/src/grpc/dfdaemon_download.rs | Adds block list enforcement + metrics for download/persistent/persistent-cache download & upload RPCs. |
| dragonfly-client/src/grpc/blocklist.rs | Implements block list evaluation logic (including regex matching) with unit tests. |
| dragonfly-client/src/dynconfig/mod.rs | Adds block list config structs and deserializes scheduler cluster client/seed-client config JSON into dynconfig state. |
| dragonfly-client/src/bin/dfdaemon/main.rs | Wires dynconfig into the download gRPC server constructor. |
| dragonfly-client/Cargo.toml | Adds regex as a workspace dependency for the client crate. |
| dragonfly-client-metric/src/lib.rs | Adds and registers blocked-task counters + collection helpers. |
| Cargo.toml | Bumps dragonfly-api to 2.2.14. |
| Cargo.lock | Lockfile updates for dragonfly-api bump and new dependency resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gaius-qi
requested changes
Feb 10, 2026
Signed-off-by: chlins <chlins.zhang@gmail.com>
5450f90 to
5646b96
Compare
…feat/blocklist Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Gaius <gaius.qi@gmail.com>
41081f6 to
7f33cdb
Compare
hhhhsdxxxx
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces logic to block certain download and upload tasks based on configurable block lists, and adds new metrics to track when such tasks are blocked. It updates both the download and upload gRPC server implementations to consult the block list before proceeding with a task, returning a permission denied error if blocked. Additionally, it adds Prometheus metrics to count blocked download and upload tasks, and updates dependencies accordingly.
Block list enforcement and metrics tracking:
Added logic to both
DfdaemonDownloadServerHandlerandDfdaemonUploadServerHandlerto check block lists (usingis_task_download_blocked,is_persistent_task_download_blocked, andis_persistent_cache_task_download_blocked) before processing download and upload requests. If a task is blocked, the server now logs a warning, increments a new blocked-task metric, and returns a permission denied error. [1] [2] [3] [4] [5] [6]Added new Prometheus metrics
DOWNLOAD_TASK_BLOCKED_COUNTandUPLOAD_TASK_BLOCKED_COUNTindragonfly-client-metric/src/lib.rs, along with corresponding collection functionscollect_download_task_blocked_metricsandcollect_upload_task_blocked_metrics, and registered these metrics in the registry. [1] [2] [3]Dependency and configuration updates:
dragonfly-apidependency version from2.2.13to2.2.14inCargo.toml.regexas a workspace dependency indragonfly-client/Cargo.toml.Infrastructure and code structure:
Dynconfig), which is now used in block list checks. [1] Fd27329fL114R133, [2] [3] [4] Fc6ac6f5L118R137, [5] [6]blocklistmodule to the gRPC module tree.Minor improvements:
These changes collectively enhance the system's ability to control which tasks are allowed based on dynamic policies, and provide observability into how often tasks are being blocked.
Description
Related Issue
Motivation and Context
Screenshots (if appropriate)