feat(dragonfly-client-config): change the default value oft the schedule_timeout (#1138)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
7e46bff143
commit
23efe2cb04
|
|
@ -953,7 +953,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dragonfly-client"
|
name = "dragonfly-client"
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
@ -1022,7 +1022,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dragonfly-client-backend"
|
name = "dragonfly-client-backend"
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dragonfly-api",
|
"dragonfly-api",
|
||||||
"dragonfly-client-core",
|
"dragonfly-client-core",
|
||||||
|
|
@ -1053,7 +1053,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dragonfly-client-config"
|
name = "dragonfly-client-config"
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytesize",
|
"bytesize",
|
||||||
"bytesize-serde",
|
"bytesize-serde",
|
||||||
|
|
@ -1081,7 +1081,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dragonfly-client-core"
|
name = "dragonfly-client-core"
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"headers 0.4.0",
|
"headers 0.4.0",
|
||||||
"hyper 1.6.0",
|
"hyper 1.6.0",
|
||||||
|
|
@ -1099,7 +1099,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dragonfly-client-init"
|
name = "dragonfly-client-init"
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
|
|
@ -1117,7 +1117,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dragonfly-client-storage"
|
name = "dragonfly-client-storage"
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
@ -1145,7 +1145,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dragonfly-client-util"
|
name = "dragonfly-client-util"
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"bytesize",
|
"bytesize",
|
||||||
|
|
@ -1560,7 +1560,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hdfs"
|
name = "hdfs"
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dragonfly-client-backend",
|
"dragonfly-client-backend",
|
||||||
"dragonfly-client-core",
|
"dragonfly-client-core",
|
||||||
|
|
|
||||||
16
Cargo.toml
16
Cargo.toml
|
|
@ -12,7 +12,7 @@ members = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.2.26"
|
version = "0.2.27"
|
||||||
authors = ["The Dragonfly Developers"]
|
authors = ["The Dragonfly Developers"]
|
||||||
homepage = "https://d7y.io/"
|
homepage = "https://d7y.io/"
|
||||||
repository = "https://github.com/dragonflyoss/client.git"
|
repository = "https://github.com/dragonflyoss/client.git"
|
||||||
|
|
@ -22,13 +22,13 @@ readme = "README.md"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
dragonfly-client = { path = "dragonfly-client", version = "0.2.26" }
|
dragonfly-client = { path = "dragonfly-client", version = "0.2.27" }
|
||||||
dragonfly-client-core = { path = "dragonfly-client-core", version = "0.2.26" }
|
dragonfly-client-core = { path = "dragonfly-client-core", version = "0.2.27" }
|
||||||
dragonfly-client-config = { path = "dragonfly-client-config", version = "0.2.26" }
|
dragonfly-client-config = { path = "dragonfly-client-config", version = "0.2.27" }
|
||||||
dragonfly-client-storage = { path = "dragonfly-client-storage", version = "0.2.26" }
|
dragonfly-client-storage = { path = "dragonfly-client-storage", version = "0.2.27" }
|
||||||
dragonfly-client-backend = { path = "dragonfly-client-backend", version = "0.2.26" }
|
dragonfly-client-backend = { path = "dragonfly-client-backend", version = "0.2.27" }
|
||||||
dragonfly-client-util = { path = "dragonfly-client-util", version = "0.2.26" }
|
dragonfly-client-util = { path = "dragonfly-client-util", version = "0.2.27" }
|
||||||
dragonfly-client-init = { path = "dragonfly-client-init", version = "0.2.26" }
|
dragonfly-client-init = { path = "dragonfly-client-init", version = "0.2.27" }
|
||||||
dragonfly-api = "=2.1.39"
|
dragonfly-api = "=2.1.39"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ fn default_download_rate_limit() -> ByteSize {
|
||||||
/// default_download_piece_timeout is the default timeout for downloading a piece from source.
|
/// default_download_piece_timeout is the default timeout for downloading a piece from source.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn default_download_piece_timeout() -> Duration {
|
fn default_download_piece_timeout() -> Duration {
|
||||||
Duration::from_secs(15)
|
Duration::from_secs(60)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// default_download_concurrent_piece_count is the default number of concurrent pieces to download.
|
/// default_download_concurrent_piece_count is the default number of concurrent pieces to download.
|
||||||
|
|
@ -167,7 +167,7 @@ fn default_scheduler_announce_interval() -> Duration {
|
||||||
/// default_scheduler_schedule_timeout is the default timeout for scheduling.
|
/// default_scheduler_schedule_timeout is the default timeout for scheduling.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn default_scheduler_schedule_timeout() -> Duration {
|
fn default_scheduler_schedule_timeout() -> Duration {
|
||||||
Duration::from_secs(180)
|
Duration::from_secs(3 * 60 * 60)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// default_dynconfig_refresh_interval is the default interval to refresh dynamic configuration from manager.
|
/// default_dynconfig_refresh_interval is the default interval to refresh dynamic configuration from manager.
|
||||||
|
|
@ -743,8 +743,35 @@ pub struct Scheduler {
|
||||||
)]
|
)]
|
||||||
pub announce_interval: Duration,
|
pub announce_interval: Duration,
|
||||||
|
|
||||||
/// schedule_timeout is the timeout for scheduling. If the scheduling timeout, dfdaemon will back-to-source
|
/// schedule_timeout is timeout for the scheduler to respond to a scheduling request from dfdaemon, default is 3 hours.
|
||||||
/// download if enable_back_to_source is true, otherwise dfdaemon will return download failed.
|
///
|
||||||
|
/// If the scheduler's response time for a scheduling decision exceeds this timeout,
|
||||||
|
/// dfdaemon will encounter a `TokioStreamElapsed(Elapsed(()))` error.
|
||||||
|
///
|
||||||
|
/// Behavior upon timeout:
|
||||||
|
/// - If `enable_back_to_source` is `true`, dfdaemon will attempt to download directly
|
||||||
|
/// from the source.
|
||||||
|
/// - Otherwise (if `enable_back_to_source` is `false`), dfdaemon will report a download failure.
|
||||||
|
///
|
||||||
|
/// **Important Considerations Regarding Timeout Triggers**:
|
||||||
|
/// This timeout isn't solely for the scheduler's direct response. It can also be triggered
|
||||||
|
/// if the overall duration of the client's interaction with the scheduler for a task
|
||||||
|
/// (e.g., client downloading initial pieces and reporting their status back to the scheduler)
|
||||||
|
/// exceeds `schedule_timeout`. During such client-side processing and reporting,
|
||||||
|
/// the scheduler might be awaiting these updates before sending its comprehensive
|
||||||
|
/// scheduling response, and this entire period is subject to the `schedule_timeout`.
|
||||||
|
///
|
||||||
|
/// **Configuration Guidance**:
|
||||||
|
/// To prevent premature timeouts, `schedule_timeout` should be configured to a value
|
||||||
|
/// greater than the maximum expected time for the *entire scheduling interaction*.
|
||||||
|
/// This includes:
|
||||||
|
/// 1. The scheduler's own processing and response time.
|
||||||
|
/// 2. The time taken by the client to download any initial pieces and download all pieces finished,
|
||||||
|
/// as this communication is part of the scheduling phase.
|
||||||
|
///
|
||||||
|
/// Setting this value too low can lead to `TokioStreamElapsed` errors even if the
|
||||||
|
/// network and scheduler are functioning correctly but the combined interaction time
|
||||||
|
/// is longer than the configured timeout.
|
||||||
#[serde(
|
#[serde(
|
||||||
default = "default_scheduler_schedule_timeout",
|
default = "default_scheduler_schedule_timeout",
|
||||||
with = "humantime_serde"
|
with = "humantime_serde"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue