Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ members = [
]

[workspace.package]
version = "1.2.16"
version = "1.2.17"
authors = ["The Dragonfly Developers"]
homepage = "https://d7y.io/"
repository = "https://github.com/dragonflyoss/client.git"
Expand All @@ -23,14 +23,14 @@ readme = "README.md"
edition = "2021"

[workspace.dependencies]
dragonfly-client = { path = "dragonfly-client", version = "1.2.16" }
dragonfly-client-core = { path = "dragonfly-client-core", version = "1.2.16" }
dragonfly-client-config = { path = "dragonfly-client-config", version = "1.2.16" }
dragonfly-client-storage = { path = "dragonfly-client-storage", version = "1.2.16" }
dragonfly-client-backend = { path = "dragonfly-client-backend", version = "1.2.16" }
dragonfly-client-metric = { path = "dragonfly-client-metric", version = "1.2.16" }
dragonfly-client-util = { path = "dragonfly-client-util", version = "1.2.16" }
dragonfly-client-init = { path = "dragonfly-client-init", version = "1.2.16" }
dragonfly-client = { path = "dragonfly-client", version = "1.2.17" }
dragonfly-client-core = { path = "dragonfly-client-core", version = "1.2.17" }
dragonfly-client-config = { path = "dragonfly-client-config", version = "1.2.17" }
dragonfly-client-storage = { path = "dragonfly-client-storage", version = "1.2.17" }
dragonfly-client-backend = { path = "dragonfly-client-backend", version = "1.2.17" }
dragonfly-client-metric = { path = "dragonfly-client-metric", version = "1.2.17" }
dragonfly-client-util = { path = "dragonfly-client-util", version = "1.2.17" }
dragonfly-client-init = { path = "dragonfly-client-init", version = "1.2.17" }
dragonfly-api = "=2.2.26"
thiserror = "2.0"
futures = "0.3.32"
Expand Down Expand Up @@ -119,6 +119,7 @@ fastrand = "2.3.0"
cgroups-rs = "0.5"
num_cpus = "1.17"
async-trait = "0.1"
humantime-serde = "1.1.1"

# TODO(Gaius): Remove the git dependency after the next release of mocktail, refer to https://github.com/IBM/mocktail/issues/65.
mocktail = { version = "0.3.0", git = "https://github.com/IBM/mocktail", rev = "860e75e171a8eb818083813dbeed4401d1a40b3b" }
Expand Down
2 changes: 1 addition & 1 deletion dragonfly-client-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ rcgen.workspace = true
reqwest.workspace = true
hostname.workspace = true
lazy_static.workspace = true
humantime-serde.workspace = true
home = "0.5.11"
humantime-serde = "1.1.1"
http-serde = "2.1.1"
1 change: 1 addition & 0 deletions dragonfly-client-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dashmap.workspace = true
reqwest-tracing.workspace = true
reqwest-middleware.workspace = true
num_cpus.workspace = true
humantime-serde.workspace = true
rustix = { version = "1.1.3", features = ["fs"] }
base64 = "0.22.1"
pnet = "0.35.0"
Expand Down
5 changes: 3 additions & 2 deletions dragonfly-client-util/src/ratelimiter/bbr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub struct BBRConfig {
pub bucket_count: u32,

/// Duration of each time bucket (e.g., 200ms).
#[serde(default = "default_bucket_interval")]
#[serde(default = "default_bucket_interval", with = "humantime_serde")]
pub bucket_interval: Duration,

/// CPU usage percentage threshold (0–100) above which the system is
Expand All @@ -116,10 +116,11 @@ pub struct BBRConfig {

/// Duration to continue shedding incoming requests after the first drop
/// event, preventing rapid oscillation between shedding and accepting.
#[serde(default = "default_shed_cooldown")]
#[serde(default = "default_shed_cooldown", with = "humantime_serde")]
pub shed_cooldown: Duration,

/// How often the background task collects CPU/memory usage metrics.
#[serde(default = "default_collect_interval", with = "humantime_serde")]
pub collect_interval: Duration,
}

Expand Down
2 changes: 1 addition & 1 deletion dragonfly-client/src/grpc/dfdaemon_download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl DfdaemonDownloadServer {
ServiceBuilder::new()
.map_err(|err: Box<dyn std::error::Error + Send + Sync>| {
if err.is::<Overloaded>() {
Status::resource_exhausted("Server is overloaded, please retry later")
Status::resource_exhausted("server is overloaded, please retry later")
} else {
Status::internal(err.to_string())
}
Expand Down
2 changes: 1 addition & 1 deletion dragonfly-client/src/grpc/dfdaemon_upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl DfdaemonUploadServer {
ServiceBuilder::new()
.map_err(|err: Box<dyn std::error::Error + Send + Sync>| {
if err.is::<Overloaded>() {
Status::resource_exhausted("Server is overloaded, please retry later")
Status::resource_exhausted("server is overloaded, please retry later")
} else {
Status::internal(err.to_string())
}
Expand Down
4 changes: 2 additions & 2 deletions dragonfly-client/src/grpc/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ where
/// tracking and response time measurement.
fn call(&mut self, req: Request<Body>) -> Self::Future {
let bbr = self.bbr.clone();
let mut inner = self.inner.clone();

let inner_clone = self.inner.clone();
let mut inner = std::mem::replace(&mut self.inner, inner_clone);
Box::pin(async move {
// Try to acquire a BBR permit. If the system is overloaded,
// the permit will be None and we reject the request.
Expand Down
Loading